Giter Site home page Giter Site logo

robole / vscode-snippets-ranger Goto Github PK

View Code? Open in Web Editor NEW
25.0 2.0 1.0 13.6 MB

View and edit all of your snippets in one purty place! Yee-haw!!

Home Page: https://marketplace.visualstudio.com/items?itemName=robole.snippets-ranger

License: MIT License

CSS 12.18% JavaScript 87.82%
snippets-ranger visual-studio-code-extension vscode-extension vscode snippets snippets-editor snippets-manager vscode-snippets-manager

vscode-snippets-ranger's Issues

Error loading webview

VS Code version OS Extension version
1.82.1 Win 10 x64 pro (french) 21H2 v0.22.1

Steps to reproduce

  1. Run Show me that dur Range, Partner

Results

Error loading webview:
Error: Could not register service worker:
InvalidStateError: Failed to register a ServiceWorker:
The document is in an invalid state..

image

Escaped backslashes (2 consecutive backslashes) not appearing correctly in HTML output

Hello. I noticed that when I create a new snippet, a dollar $ sign (or a variable starting with dollar) is removed, not preserved. Could you make so that a variable starting with dollar is preserved, and the dollar sign is escaped?

Example: right now, when I want to create a snippet out of this line:
$statement = ->pdo->prepare($sql);

I get this (notice that I loose the variables):
"= ->pdo->prepare();",

Instead, I would like it to automatically look like this:
"\\$statement = ->pdo->prepare(\\$sql);",

thank you.

Button to copy snippet text / possibly already to user defined snippet file

Thanks for the extension, it makes life certainly easier!

Is your feature request related to a problem?

If I want to overwrite a builtin snippet (e.g. chaning or adding a trigger), it is hard to just get the snippet definition because the snippet definition files do contain line breaks.

Describe the solution you'd like

It would be nice if we have a button to simply copy the entire snippet in question.

Describe alternatives you've considered

Alternatively, or in addition, a button to automatically copy the snippet to a user defined file and open that file to edit it.

Additional context

Aren't changed / deleted builtin or extension snippets back to the default after an update?

dollar sign disappears when creating new snippet from selection

What happens:
When I select this code in a php file, containing variables that start with dollar,

$statement = $this->pdo->prepare($sql);

and then do "Code Ranger : Add new snippet", I get the following result in the snippets json file:

"enter a name" : {
    "prefix": "",
    "body": ["  = ->pdo->prepare( );"],
    "description": ""
},

Notice above how all variables that started with a dollar completely disappeared from the selection in the resulting snippet.

What I expect:

  • The variables should not disappear.
  • The dollar should be included from the original selection, AND escaped like this:
"enter a name" : {
    "prefix": "",
    "body": ["\\$statement = \\$this->pdo->prepare(\\$sql);"],
    "description": ""
},

I hope this clarifies the issue. Many thanks.

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.