Skip to content

Commit

Permalink
Code Review Changes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
greazer committed Apr 12, 2018
1 parent 016014e commit 122e176
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 38 deletions.
66 changes: 33 additions & 33 deletions Extension/ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,41 @@ Microsoft C/C++ Extension for Visual Studio Code incorporates components from th
1. agent-base (https://github.com/TooTallNate/node-agent-base)
2. ANTLR (http://www.antlr2.org/)
3. Boost (http://www.boost.org)
4. Clang (https://clang.llvm.org/)
5. debug (https://github.com/visionmedia/debug)
6. extend (https://github.com/justmoon/node-extend)
7. fd-slicer (https://github.com/andrewrk/node-fd-slicer)
8. gcc-6/libgcc (http://packages.ubuntu.com/yakkety/main/gcc-6)
9. Guidelines Support Library (https://github.com/Microsoft/GSL)
10. http-proxy-agent (https://github.com/TooTallNate/node-http-proxy-agent)
11. https-proxy-agent (https://github.com/TooTallNate/node-https-proxy-agent)
12. jsonc-parser (https://github.com/Microsoft/node-jsonc-parser)
13. libc++ (https://libcxx.llvm.org/index.html)
14. LLDB (https://lldb.llvm.org/)
15. LLVM (http://llvm.org/)
16. MI Debug Engine (https://github.com/Microsoft/MIEngine)
17. Minimatch (https://github.com/isaacs/minimatch)
18. minimist (https://github.com/substack/minimist)
19. mkdirp (https://github.com/substack/node-mkdirp)
20. Mono (https://github.com/mono/mono)
21. ms (https://github.com/rauchg/ms.js)
22. msgpack for C/C++ (https://github.com/msgpack/msgpack-c)
23. node-http-proxy-agent (https://github.com/TooTallNate/node-https-proxy-agent)
24. node-https-proxy-agent (https://github.com/TooTallNate/node-https-proxy-agent)
25. os-tmpdir (https://github.com/sindresorhus/os-tmpdir)
26. Pend (https://github.com/andrewrk/node-pend)
27. pevents (https://github.com/neosmart/pevents)
28. RapidJSON (https://github.com/miloyip/rapidjson)
29. semver (https://github.com/npm/node-semver)
30. SQLite (https://www.sqlite.org/)
4. C++11 Sublime Text Snippets (https://github.com/Rapptz/cpp-sublime-snippet)
5. Clang (https://clang.llvm.org/)
6. debug (https://github.com/visionmedia/debug)
7. extend (https://github.com/justmoon/node-extend)
8. fd-slicer (https://github.com/andrewrk/node-fd-slicer)
9. gcc-6/libgcc (http://packages.ubuntu.com/yakkety/main/gcc-6)
10. Guidelines Support Library (https://github.com/Microsoft/GSL)
11. http-proxy-agent (https://github.com/TooTallNate/node-http-proxy-agent)
12. https-proxy-agent (https://github.com/TooTallNate/node-https-proxy-agent)
13. jsonc-parser (https://github.com/Microsoft/node-jsonc-parser)
14. libc++ (https://libcxx.llvm.org/index.html)
15. LLDB (https://lldb.llvm.org/)
16. LLVM (http://llvm.org/)
17. MI Debug Engine (https://github.com/Microsoft/MIEngine)
18. Minimatch (https://github.com/isaacs/minimatch)
19. minimist (https://github.com/substack/minimist)
20. mkdirp (https://github.com/substack/node-mkdirp)
21. Mono (https://github.com/mono/mono)
22. ms (https://github.com/rauchg/ms.js)
23. msgpack for C/C++ (https://github.com/msgpack/msgpack-c)
24. node-http-proxy-agent (https://github.com/TooTallNate/node-https-proxy-agent)
25. node-https-proxy-agent (https://github.com/TooTallNate/node-https-proxy-agent)
26. os-tmpdir (https://github.com/sindresorhus/os-tmpdir)
27. Pend (https://github.com/andrewrk/node-pend)
28. pevents (https://github.com/neosmart/pevents)
29. RapidJSON (https://github.com/miloyip/rapidjson)
30. semver (https://github.com/npm/node-semver)
31. SQLite (https://www.sqlite.org/)
Includes:functions (from fossil) (https://fossil-scm.org)
31. Tmp (https://github.com/raszi/node-tmp)
32. Tmp (https://github.com/raszi/node-tmp)
Includes:sample code (https://blog.tompawlak.org/generate-random-values-nodejs-javascript)
32. vscode-debugadapter (https://github.com/Microsoft/vscode-debugadapter-node)
33. vscode-extension-telemetry (https://github.com/Microsoft/vscode-extension-telemetry)
34. vscode-languageserver-node (https://github.com/Microsoft/vscode-languageserver-node)
35. yauzl (https://github.com/thejoshwolfe/yauzl)
36. C++11 Sublime Text Snippets (https://github.com/Rapptz/cpp-sublime-snippet)
33 vscode-debugadapter (https://github.com/Microsoft/vscode-debugadapter-node)
34. vscode-extension-telemetry (https://github.com/Microsoft/vscode-extension-telemetry)
35. vscode-languageserver-node (https://github.com/Microsoft/vscode-languageserver-node)
36. yauzl (https://github.com/thejoshwolfe/yauzl)


%% agent-base NOTICES AND INFORMATION BEGIN HERE
Expand Down
2 changes: 1 addition & 1 deletion Extension/cpp_snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"prefix": "switch",
"body": "\nswitch (${1:expression})\n{\n\tcase ${2:/* constant-expression */}:\n\t\t${3:/* code */}\n\t\tbreak;\n\n\tdefault:\n\t\tbreak;\n}",
"description": "Code snippet for switch",
"scope": "source.c++, source.objc++"
"scope": "source.c, source.objc, source.c++, source.objc++"
},

////////////////////////////////
Expand Down
9 changes: 9 additions & 0 deletions Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@
"title": "Navigate...",
"category": "C/Cpp"
},
{
"command": "C_Cpp.ToggleSnippets",
"title": "Toggle Snippets",
"category": "C/Cpp"
},
{
"command": "C_Cpp.ToggleErrorSquiggles",
"title": "Toggle Error Squiggles",
Expand Down Expand Up @@ -1118,6 +1123,10 @@
{
"language": "cpp",
"path": "./cpp_snippets.json"
},
{
"language": "c",
"path": "./cpp_snippets.json"
}
]
},
Expand Down
9 changes: 5 additions & 4 deletions Extension/src/LanguageServer/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ function registerCommands(): void {
disposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationEdit', onEditConfiguration));
disposables.push(vscode.commands.registerCommand('C_Cpp.AddToIncludePath', onAddToIncludePath));
disposables.push(vscode.commands.registerCommand('C_Cpp.ToggleErrorSquiggles', onToggleSquiggles));
disposables.push(vscode.commands.registerCommand('C_Cpp.ToggleSnippets', onToggleSnippets));
disposables.push(vscode.commands.registerCommand('C_Cpp.ToggleIncludeFallback', onToggleIncludeFallback));
disposables.push(vscode.commands.registerCommand('C_Cpp.ToggleDimInactiveRegions', onToggleDimInactiveRegions));
disposables.push(vscode.commands.registerCommand('C_Cpp.ShowReleaseNotes', onShowReleaseNotes));
Expand Down Expand Up @@ -322,18 +323,18 @@ function onAddToIncludePath(path: string): void {
}
}

function onToggleSnippets(): void {
function onToggleSquiggles(): void {
onActivationEvent();
// This only applies to the active client.
let settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
settings.toggleSetting("snippets", "Enabled", "Disabled");
settings.toggleSetting("errorSquiggles", "Enabled", "Disabled");
}

function onToggleSquiggles(): void {
function onToggleSnippets(): void {
onActivationEvent();
// This only applies to the active client.
let settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
settings.toggleSetting("errorSquiggles", "Enabled", "Disabled");
settings.toggleSetting("snippets", "Enabled", "Disabled");
}

function onToggleIncludeFallback(): void {
Expand Down

0 comments on commit 122e176

Please sign in to comment.