diff --git a/Documentation/LanguageServer/How to Contribute Changes.md b/Documentation/LanguageServer/How to Contribute Changes.md index 0d65701f4..2a13cbf04 100644 --- a/Documentation/LanguageServer/How to Contribute Changes.md +++ b/Documentation/LanguageServer/How to Contribute Changes.md @@ -12,7 +12,7 @@ * `processRuntimeDependencies` handles the downloading and installation of the OS-dependent files. Downloading code exists in [packageManager.ts](../../Extension/src/packageManager.ts). * `downloadCpptoolsJsonPkg` handles the `cpptools.json`, which can be used to enable changes to occur mid-update, such as turning the `intelliSenseEngine` to `"Default"` for a certain percentage of users. * The debugger code is in the [Debugger](https://github.com/Microsoft/vscode-cpptools/Extension/src/Debugger) folder. - * [LanguageServer/client.ts](../../Extension/src/LanguageServer/C_Cpp.ts) handles various language server functionality. + * [LanguageServer/client.ts](../../Extension/src/LanguageServer/client.ts) handles various language server functionality. * [LanguageServer/configurations.ts](../../Extension/src/LanguageServer/configurations.ts) handles functionality related to `c_cpp_properties.json`. * [telemetry.ts](../../Extension/src/telemetry.ts): Telemetry data gets sent to either `logLanguageServerEvent` or `logDebuggerEvent`. * The Tag Parser (symbol database) doesn't automatically expand macros, so the [cpp.hint](../../Extension/cpp.hint) file contains definitions of macros that should be expanded in order for symbols to be parsed correctly. diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index 10a2d4b20..ab8d448a6 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,6 +1,6 @@ # C/C++ for Visual Studio Code Change Log -## Version 0.14.6: Janurary 2, 2017 +## Version 0.14.6: Janurary 16, 2017 * Fix tag parser failing (and continuing to fail after edits) when it shouldn't. [#1367](https://github.com/Microsoft/vscode-cpptools/issues/1367) * Fix tag parser taking too long due to redundant processing. [#1288](https://github.com/Microsoft/vscode-cpptools/issues/1288) * Fix debugging silently failing the 1st time if a C/C++ file isn't opened. [#1366](https://github.com/Microsoft/vscode-cpptools/issues/1366) @@ -8,6 +8,11 @@ * Fix extra reload message after installing with VS Code 1.19. [#1362](https://github.com/Microsoft/vscode-cpptools/issues/1362) * Fix incorrect "Warning: Expected file ... is missing" message after installing on Linux. [#1334](https://github.com/Microsoft/vscode-cpptools/issues/1334) * Fix "Include file not found" messages not re-appearing after settings changes. [#1363](https://github.com/Microsoft/vscode-cpptools/issues/1363) +* Performance improvements with `browse.path` parsing, and stop showing "Parsing files" when there's no actual parsing. [#1393](https://github.com/Microsoft/vscode-cpptools/issues/1393) +* Fix crash when settings with the wrong type are used. [#1396](https://github.com/Microsoft/vscode-cpptools/issues/1396) +* Allow semicolons in `browse.path`. [#1415](https://github.com/Microsoft/vscode-cpptools/issues/1415) +* Add `C_Cpp.workspaceParsingPriority` setting to avoid using 100% CPU during parsing of workspace files. +* Add `C_Cpp.exclusionPolicy` default to `checkFolders` to avoid expensive `files.exclude` checking on every file. ## Version 0.14.5: December 18, 2017 * Fix for stackwalk `NullReferenceException`. [#1339](https://github.com/Microsoft/vscode-cpptools/issues/1339) diff --git a/Extension/package.json b/Extension/package.json index 302399a34..8b5393499 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -172,6 +172,28 @@ "default": true, "description": "Controls whether files are automatically added to files.associations when they are the target of a navigation operation from a C/C++ file.", "scope": "resource" + }, + "C_Cpp.workspaceParsingPriority": { + "type": "string", + "enum": [ + "highest", + "high", + "normal", + "low" + ], + "default": "normal", + "description": "Controls whether parsing of the non-active workspace files uses sleeps to avoid using 100% CPU. The values highest/high/normal/low correspond to approximately 100/75/50/25% CPU usage.", + "scope": "resource" + }, + "C_Cpp.exclusionPolicy": { + "type": "string", + "enum": [ + "checkFolders", + "checkFilesAndFolders" + ], + "default": "checkFolders", + "description": "Instructs the extension when to use the \"files.exclude\" setting when determining which files should be added to the code navigation database while traversing through the paths in the \"browse.path\" array. \"checkFolders\" means that the exclusion filters will only be evaluated once per folder (individual files are not checked). \"checkFilesAndFolders\" means that the exclusion filters will be evaluated against every file and folder encountered. If your \"files.exclude\" setting only contains folders, then \"checkFolders\" is the best choice and will increase the speed at which the extension can initialize the code navigation database.", + "scope": "resource" } } }, @@ -1048,7 +1070,7 @@ "tmp": "~0.0.33", "vscode-debugadapter": "~1.24.0", "vscode-debugprotocol": "~1.24.0", - "vscode-extension-telemetry": "~0.0.8", + "vscode-extension-telemetry": "~0.0.10", "vscode-languageclient": "~3.4.5", "yauzl": "~2.8.0" }, diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 9f7964c25..cee3b89d2 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -329,7 +329,9 @@ class DefaultClient implements Client { intelliSenseEngineFallback: settings.intelliSenseEngineFallback, autocomplete: settings.autoComplete, errorSquiggles: settings.errorSquiggles, - loggingLevel: settings.loggingLevel + loggingLevel: settings.loggingLevel, + workspaceParsingPriority: settings.workspaceParsingPriority, + exclusionPolicy: settings.exclusionPolicy }, middleware: createProtocolFilter(this, allClients), // Only send messages directed at this client. errorHandler: { diff --git a/Extension/src/LanguageServer/settings.ts b/Extension/src/LanguageServer/settings.ts index 38c079d04..055537d88 100644 --- a/Extension/src/LanguageServer/settings.ts +++ b/Extension/src/LanguageServer/settings.ts @@ -28,7 +28,7 @@ export class CppSettings extends Settings { constructor(resource?: vscode.Uri) { super("C_Cpp", resource); } - + public get clangFormatPath(): string { return super.Section.get("clang_format_path"); } public get clangFormatStyle(): string { return super.Section.get("clang_format_style"); } public get clangFormatFallbackStyle(): string { return super.Section.get("clang_format_fallbackStyle"); } @@ -42,6 +42,8 @@ export class CppSettings extends Settings { public get loggingLevel(): string { return super.Section.get("loggingLevel"); } public get navigationLength(): number { return super.Section.get("navigation.length", 60); } public get filesAssociationsAutoAdd(): boolean { return super.Section.get("files.associations.autoAdd"); } + public get workspaceParsingPriority(): boolean { return super.Section.get("workspaceParsingPriority"); } + public get exclusionPolicy(): boolean { return super.Section.get("exclusionPolicy"); } public toggleSetting(name: string, value1: string, value2: string): void { let value: string = super.Section.get(name);