Comments (11)
Yes, I mean the matching of paired parentheses.
from wikitext-vscode-extension.
Sounds good, thanks mate! If necessary, feel free to adapt my previous response for the documentation, e.g. for a section "Known issues". Greetings and have a nice evening
from wikitext-vscode-extension.
Due to some API technical limitations, I can't control the correct rendering of bracket highlighting, so I disabled this feature in the latest version. I'm thinking of some other countermeasures to improve the problem.
Also, I've noticed that some themes may not render editor tokens correctly. But the default Dark+ theme is ok, if it doesn't have any highlight on some popular theme, please let me know.
from wikitext-vscode-extension.
Righto, not surprising then that brackets don't highlight if that's been disabled! I sure hope that'll be back in future versions; at least for me, bracket highlighting is pretty much the most important feature, e.g. when writing complex templates (well, I should probably learn Lua and switch to Modules anyway ๐ฌ but for now...). Anyway, I appreciate that those API limitations are currently in the way so no complains here. Re: themes, I only use the default dark theme, so no experience with others.
from wikitext-vscode-extension.
Another solution is to use the previous solution, adding highlighting to each parenthesis. I'm wondering if you think it's better to use a scheme like this as shown in the picture (which might make the display too fancy), or would you rather have no highlighting?
PS: Just an investigation and may not end up selecting these options.
from wikitext-vscode-extension.
Is this just about syntax highlighting in general, or about matching bracket pairs? Because, especially in wikitext where you can't have indention and stuff, I really need to find bracket pairs quickly in large templates.
from wikitext-vscode-extension.
Another solution is to use the previous solution, adding highlighting to each parenthesis. I'm wondering if you think it's better to use a scheme like this as shown in the picture (which might make the display too fancy), or would you rather have no highlighting?
No, highlighting single brackets isn't helpful. The ideal solution is something like this:
This solution (1) matches double curly braces (templates) as well as triple curly braces (parameters) and (2) uses different colors if templates or paremeters are nested. Which happens to be what I get with Wikitext extension v3.6.5, running on VC 1.74.0 for macOS 10.15.7.
from wikitext-vscode-extension.
The problem is that such highlights will render incorrectly in many edge cases:
{{t|{{#if:|}}}}
Some people complain about wrong rendering like this.
from wikitext-vscode-extension.
/offtopic start
Especially in wikitext where you can't have indention
If indentation is giving you trouble, I would recommend to still write clean code in VC Code โ i.e., with appropriate line breaks and indentsย โ and then save a copy with all line breaks and indents removed for use in MediaWiki. This can easily be done in VC Code by selecting all code and pressing ctrl
+j
(on mac, don't know what the Windows hotkey is). This is incredibly useful even when you have bracket highlighting. BTW, I've found that indentation actually does work well in most cases (MW 1.38 / 1.39); but yeah, there's the odd case where it doesn't work. In those cases I would use the method described above.
/offtopic end
from wikitext-vscode-extension.
The problem is that such highlights will render incorrectly in many edge cases:
{{t|{{#if:|}}}}
This isn't really an edge case, it's simply a nested template where two or more closing brackets are right next to each other (i.e., without other characters between them). (In this case it's a parser function nested inside a template, but given that a parser function also has 2 curly brackets at its start and end, I assume that won't make a difference?).
Anyway, users can fix the issue that you show by adding a space between the closing brackets:
Another way to fix this is adding line breaks before parameters:
I've found that both solutions work well in most cases, i.e. they won't break wikitext functionality.
I would agree that not having to use such workaround would be even more convenient. But for me personally it's acceptable. Especially since using linebreaks is often the cleanest solution anyway (see my previous response to @shaedrich). In any case, using this very small workaround is imho preferable to not having bracket matching at all.
from wikitext-vscode-extension.
OK, I'll take your opinion. And try to restore this functionality in a future minor version update.
from wikitext-vscode-extension.
Related Issues (20)
- There are always extra `"` in the preview HOT 3
- Error when pushing changes HOT 2
- can't pull page HOT 2
- Editing Scribunto module - Cannot read properties of undefined (reading 'join');
- Update the extensions to Web extensions
- Wikimedia Two-factor_authentication HOT 2
- Web Extension Error: `TypeError: Failed to fetch`
- Add basic authentication to settings. HOT 3
- Credential requirement HOT 1
- Commands resolving to Not Found HOT 5
- Citation Snippets for free! HOT 1
- Treat `|}` as table closure only at start of line HOT 5
- Error on launching preview HOT 7
- Braces highlight mismatch HOT 2
- Highlight error caused by `{{` in the HTML tag HOT 1
- Bug: preview doesn't work HOT 7
- Better edit summaries? HOT 3
- Extension committing edits while logged out HOT 8
- Private wiki support? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wikitext-vscode-extension.