Command suggestions in Vscode

Asked

Viewed 1,569 times

4

I am programming in React-Native using Visual Studio Code, in the extensions I installed

  • Eslint
  • Javascript (ES6) code snippets
  • jsx
  • React Native tools
  • React-Native/React/Redux snippets for es6/es7
  • Reactjs code snippets

But none of them did what I want, which is to give suggestions for commands like style formatting (fontWeight, backgroundColor) and the options, or the main ones, this kind of thing.

Kind of turn into a real ide

3 answers

3


You can also create your own snippets

Goes into File > Preferences > User Snippets at the prompt you open choose JavaScript for example and creates your Binds.

inserir a descrição da imagem aqui

Look at the example below: (in this case the "bgc" is the shortcut to insert the text )

"Cor do Background": {
    "prefix": "bgc",
    "body": [
        "backgroundColor"
    ],
    "description": "colocar cor no background"
}

Another example:

"Estilo de fontWeight": {
    "prefix": "ftw",
    "body": [
        "fontWeight"
    ],
    "description": "colocar estilo de Font Weight"
}

In the model above the shortcut "Ftw" fires the text fontWeight complete.

You can even create snippets for entire templates, after a read in the official documentation

https://code.visualstudio.com/docs/editor/userdefinedsnippets

inserir a descrição da imagem aqui

2

There is a plugin that makes your Vscode use the same shortcut keys as Eclipse, can be a solution. The plugin name is: Eclipse Keymap.

  • I will give +1 because I really liked the plugin, but it is not what I need, it modifies the shortcuts but does not attach suggestions

1

To autocomplete CSS parameters and values you can use the extension Intellisense for CSS Class Names which provides autocomplete for the CSS class name for the attribute of the HTML class based on the CSS files in its workspace and also supports the attribute className React (which may also solve your problem).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.