搜索命令 您可以使用 ES7 片段搜索命令搜索片段,该命令可以使用 CMD + Shift + P 运行,或者仅使用 CMD + Shift + R(对于 Windows 和 Linux 为 CTRL + ALT + R)键绑定。
你必须降级到
v3.1.1
才能工作,我遇到了类似的问题并以这种方式解决了它,我认为更新的版本不起作用fsr
右键单击扩展程序并选择
install another version
,然后在顶部会出现版本列表,然后选择v3.1.1
我也有同样的问题。 对我来说,这个设置选项很有效。
"editor.suggest.showSnippets": true,
// Controls if quick suggestions should show up while typing
//code snippet Issue https://stackoverflow.com/questions/44321000/visual-studio-code-user-snippets-not-working
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true,
},
// top: Show snippet suggestions on top of other suggestions.
"editor.snippetSuggestions": "top",
// Controls whether to automatically show inline suggestions in the editor
"editor.inlineSuggest.enabled": true,
// setting which controls if suggestions are triggered by special characters.
"editor.suggestOnTriggerCharacters": true,
// Controls auto complete on dot(.)
// https://stackoverflow.com/questions/49447663/disable-autocomplete-on-dot-in-vscode
"editor.acceptSuggestionOnCommitCharacter": false,
// Controls whether sorting favours words that appear close to the cursor
"editor.suggest.localityBonus": true,
// Controls how suggestions are pre-selected when showing the suggest list
"editor.suggestSelection": "recentlyUsed",
// Controls the delay in ms after which quick suggestions will show up.
// If set to -1, quick suggestions will show up immediately.
// If set to +500, quick suggestions will not show up because of Github Copilot
"editor.quickSuggestionsDelay": 100,
"editor.suggest.snippetsPreventQuickSuggestions": false,
// Controls if pressing tab inserts the best suggestion and if tab cycles through other suggestions
"editor.tabCompletion": "on",
// Enable word based suggestions
"editor.wordBasedSuggestions": true,
"editor.suggest.showColors": true,
"editor.suggest.showConstants": true,
"editor.suggest.showConstructors": true,
"editor.suggest.showCustomcolors": true,
"editor.suggest.showDeprecated": false,
"editor.suggest.showEnumMembers": true,
"editor.suggest.showEnums": true,
"editor.suggest.showEvents": true,
"editor.suggest.showFields": true,
"editor.suggest.showFiles": true,
"editor.suggest.showFolders": true,
"editor.suggest.showFunctions": true,
"editor.suggest.showInterfaces": true,
"editor.suggest.showIssues": true,
"editor.suggest.showKeywords": true,
"editor.suggest.showMethods": true,
"editor.suggest.showModules": true,
"editor.suggest.showOperators": true,
"editor.suggest.showProperties": true,
"editor.suggest.showReferences": true,
"editor.suggest.showSnippets": true,
"editor.suggest.showStructs": true,
"editor.suggest.showTypeParameters": true,
"editor.suggest.showVariables": true,
"editor.suggest.showValues": true,
"editor.suggest.showWords": true,
"editor.suggest.showUsers": true,
"editor.suggest.showUnits": true,
有同样的问题,请检查:
打开 VSCode JSON 设置,
“ctrl + shift + P”或“Cmd + Shift + P”=>然后输入“打开设置(JSON)”
复制您当前的设置并保存到其他地方以便再次使用, 然后清除所有 JSON 设置并通过“ctrl + s”保存,关闭 VSCode 并再次打开,检查 ES7 片段是否有效,然后再次进入 JSON 设置并粘贴之前复制的设置。
<Ctrl><Shift>P
Preferences: Open Settings (JSON)
<Ctrl>F
editor.quickSuggestions
改变
"other": false
到
"other": true
这解决了我的问题。
该扩展程序已停止为您工作,因为您可能会更改某些设置。
"editor.snippetSuggestions": "top", /*make sure this is NOT "none"*/
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true
},
"editor.wordBasedSuggestions": true,
"html.suggest.html5": false,
"typescript.suggest.paths": false,
"javascript.suggest.paths": false,
作为快速实验,您可以复制整个代码,将其粘贴到settings.json的末尾,保存,然后重新启动VSC。
如果它解决了您的问题,您可以将命令一一排序,以找出导致您问题的原因。
访问 VS Code Marketplace,搜索 ES7+ React/Redux/React-Native snippets 扩展,然后将其直接安装在本地 VS Code 应用程序中。