Code Monkey home page Code Monkey logo

Comments (11)

Frederisk avatar Frederisk commented on May 29, 2024 1

Yes, I mean the matching of paired parentheses.

from wikitext-vscode-extension.

DevarooGit avatar DevarooGit commented on May 29, 2024 1

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.

Frederisk avatar Frederisk commented on May 29, 2024

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.

DevarooGit avatar DevarooGit commented on May 29, 2024

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.

Frederisk avatar Frederisk commented on May 29, 2024

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?

image

PS: Just an investigation and may not end up selecting these options.

from wikitext-vscode-extension.

shaedrich avatar shaedrich commented on May 29, 2024

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.

DevarooGit avatar DevarooGit commented on May 29, 2024

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:

VS-Studio-Code-Wikitext-Bracket-Highlighting

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.

Frederisk avatar Frederisk commented on May 29, 2024

The problem is that such highlights will render incorrectly in many edge cases:

{{t|{{#if:|}}}}

image

Some people complain about wrong rendering like this.

from wikitext-vscode-extension.

DevarooGit avatar DevarooGit commented on May 29, 2024

/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.

DevarooGit avatar DevarooGit commented on May 29, 2024

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:

Screenshot 2023-01-08 at 13 40 43

Another way to fix this is adding line breaks before parameters:

Screenshot 2023-01-08 at 13 40 44

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.

Frederisk avatar Frederisk commented on May 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.