Git Product home page Git Product logo

Comments (5)

jeremychone avatar jeremychone commented on June 27, 2024 1

This is a good idea. I added at #22.

from vscode-toggle-quotes.

jeremychone avatar jeremychone commented on June 27, 2024

Interesting. yes, this would be outside. Now, what you could do, is do a regex multi selection, in the search,
image

There must be a way to select all matches. And then, toggle it. Should work.

from vscode-toggle-quotes.

v-kydela avatar v-kydela commented on June 27, 2024

That's tricky because Toggle Quotes only seems to work if the select text is exactly between a pair of quotes and not if the selected text includes the quotes.

If I try (["'`]).*?\1 then I get this

image

That won't work because the match includes the quotes and Toggle Quotes won't accept that

If I try (?<=(["'`])).*?(?=\1) then I get this

image

That won't work because of the text outside the quotes that still gets recognized as being between quotes (": ")

Finally, I came across this solution: (?<=["])[^"]*(?="(?:(?:[^"]*"){2})*[^"]*$)

It works only for one type of quote at a time, and it's still much more complicated than the other expressions. Would it be possible for the Toggle Quotes extension to be more lenient with what particular text needs to be selected?

from vscode-toggle-quotes.

jeremychone avatar jeremychone commented on June 27, 2024

interesting. I understand the regex challenge.

The issue is that the "ignore selected" text is by design to allow a simple and custom way to "exclude" some text from the toggle change.

Now, perhaps, you can split it two steps. First get names '...':, before the ':, and then, another step with the : ' assuming all is formatted this way.

from vscode-toggle-quotes.

v-kydela avatar v-kydela commented on June 27, 2024

Could Toggle Quotes be split into two commands, "Toggle Quotes: Surrounding" and "Toggle Quotes: Within"? It seems like the "within" option would be even easier to implement than the original "surrounding" option, and it would give us the ability to select all and then toggle quotes for the whole document.

from vscode-toggle-quotes.

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.