Skip to content

Commit

Permalink
Add Setting to Enable Markdown Comment Formatting (#11177)
Browse files Browse the repository at this point in the history
* resolve PR

* resolve PR

* resolve PR

* resolve PR

* resolve PR

* resolve PR
  • Loading branch information
browntarik committed Jul 18, 2023
1 parent 2133b87 commit 6684991
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
16 changes: 16 additions & 0 deletions Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,22 @@
],
"scope": "resource"
},
"C_Cpp.markdownInComments": {
"type": "string",
"enum": [
"subsetEnabled",
"enabled",
"disabled"
],
"enumDescriptions": [
"%c_cpp.configuration.markdownInComments.subsetEnabled.description%",
"%c_cpp.configuration.markdownInComments.enabled.description%",
"%c_cpp.configuration.markdownInComments.disabled.description%"
],
"default": "subsetEnabled",
"description": "%c_cpp.configuration.markdownInComments.description%",
"scope": "resource"
},
"C_Cpp.hover": {
"type": "string",
"enum": [
Expand Down
4 changes: 4 additions & 0 deletions Extension/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@
"c_cpp.configuration.caseSensitiveFileSupport.markdownDescription": { "message": "If set to `default`, the file system of the workspace is assumed to be case insensitive on Windows and case sensitive on macOS or Linux. If set to `enabled`, the file system of the workspace is assumed to be case sensitive on Windows.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] },
"c_cpp.configuration.enhancedColorization.markdownDescription": { "message": "If enabled, code is colorized based on IntelliSense. This setting only applies if `#C_Cpp.intelliSenseEngine#` is set to `default`.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] },
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
"c_cpp.configuration.markdownInComments.description": "Select whether markdown will be available in the hover tooltip. By default, only a subset of markdown will be applied to comments in the hover tooltip.",
"c_cpp.configuration.markdownInComments.subsetEnabled.description": "Enable all markdown features in the hover tooltip except those that include the '_' and '*' characters.",
"c_cpp.configuration.markdownInComments.enabled.description": "Enable all markdown features in the hover tooltip.",
"c_cpp.configuration.markdownInComments.disabled.description": "Disable all markdown features in the hover tooltip.",
"c_cpp.configuration.hover.description": "If disabled, hover details are no longer provided by the language server.",
"c_cpp.configuration.vcpkg.enabled.markdownDescription": { "message": "Enable integration services for the [vcpkg dependency manager](https://aka.ms/vcpkg/).", "comment": [ "Markdown text between () should not be altered: https://en.wikipedia.org/wiki/Markdown" ] },
"c_cpp.configuration.addNodeAddonIncludePaths.markdownDescription": { "message": "Add include paths from `nan` and `node-addon-api` when they are dependencies.", "comment": [ "Markdown text between `` should not be translated or localized (they represent literal text) and the capitalization, spacing, and punctuation (including the ``) should not be altered." ] },
Expand Down
1 change: 1 addition & 0 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,7 @@ export class DefaultClient implements Client {
clangTidyFixNotes: settings.clangTidyFixNotes,
clangTidyChecksEnabled: settings.clangTidyChecksEnabled,
clangTidyChecksDisabled: settings.clangTidyChecksDisabled,
markdownInComments: settings.markdownInComments,
hover: settings.hover,
vcFormatIndentBraces: settings.vcFormatIndentBraces,
vcFormatIndentMultiLineRelativeTo: settings.vcFormatIndentMultiLineRelativeTo,
Expand Down
4 changes: 3 additions & 1 deletion Extension/src/LanguageServer/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import * as nls from 'vscode-nls';
import * as which from 'which';
import { getCachedClangFormatPath, getCachedClangTidyPath, getExtensionFilePath, setCachedClangFormatPath, setCachedClangTidyPath } from '../common';
import { isWindows } from '../constants';
import { cachedEditorConfigLookups, cachedEditorConfigSettings, DefaultClient, hasTrustedCompilerPaths } from './client';
import { DefaultClient, cachedEditorConfigLookups, cachedEditorConfigSettings, hasTrustedCompilerPaths } from './client';
import { clients } from './extension';
import { CommentPattern } from './languageConfig';
import { PersistentState } from './persistentState';
Expand Down Expand Up @@ -63,6 +63,7 @@ export interface WorkspaceFolderSettingsParams {
clangTidyChecksEnabled: string[] | undefined;
clangTidyChecksDisabled: string[] | undefined;
hover: string | undefined;
markdownInComments: string | undefined;
vcFormatIndentBraces: boolean | undefined;
vcFormatIndentMultiLineRelativeTo: string | undefined;
vcFormatIndentWithinParentheses: string | undefined;
Expand Down Expand Up @@ -423,6 +424,7 @@ export class CppSettings extends Settings {
public get caseSensitiveFileSupport(): boolean { return !isWindows || super.Section.get<string>("caseSensitiveFileSupport") === "enabled"; }
public get doxygenSectionTags(): string[] | undefined { return super.Section.get<string[]>("doxygen.sectionTags"); }
public get hover(): string | undefined { return super.Section.get<string>("hover"); }
public get markdownInComments(): string | undefined { return super.Section.get<string>("markdownInComments"); }
public get legacyCompilerArgsBehavior(): boolean | undefined { return super.Section.get<boolean>("legacyCompilerArgsBehavior"); }

public get inlayHintsAutoDeclarationTypes(): boolean {
Expand Down

0 comments on commit 6684991

Please sign in to comment.