Skip to content

Commit 6684991

Browse files
authored
Add Setting to Enable Markdown Comment Formatting (#11177)
* resolve PR * resolve PR * resolve PR * resolve PR * resolve PR * resolve PR
1 parent 2133b87 commit 6684991

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

Extension/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,22 @@
456456
],
457457
"scope": "resource"
458458
},
459+
"C_Cpp.markdownInComments": {
460+
"type": "string",
461+
"enum": [
462+
"subsetEnabled",
463+
"enabled",
464+
"disabled"
465+
],
466+
"enumDescriptions": [
467+
"%c_cpp.configuration.markdownInComments.subsetEnabled.description%",
468+
"%c_cpp.configuration.markdownInComments.enabled.description%",
469+
"%c_cpp.configuration.markdownInComments.disabled.description%"
470+
],
471+
"default": "subsetEnabled",
472+
"description": "%c_cpp.configuration.markdownInComments.description%",
473+
"scope": "resource"
474+
},
459475
"C_Cpp.hover": {
460476
"type": "string",
461477
"enum": [

Extension/package.nls.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@
242242
"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." ] },
243243
"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." ] },
244244
"c_cpp.configuration.codeFolding.description": "If enabled, code folding ranges are provided by the language server.",
245+
"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.",
246+
"c_cpp.configuration.markdownInComments.subsetEnabled.description": "Enable all markdown features in the hover tooltip except those that include the '_' and '*' characters.",
247+
"c_cpp.configuration.markdownInComments.enabled.description": "Enable all markdown features in the hover tooltip.",
248+
"c_cpp.configuration.markdownInComments.disabled.description": "Disable all markdown features in the hover tooltip.",
245249
"c_cpp.configuration.hover.description": "If disabled, hover details are no longer provided by the language server.",
246250
"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" ] },
247251
"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." ] },

Extension/src/LanguageServer/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,6 +1440,7 @@ export class DefaultClient implements Client {
14401440
clangTidyFixNotes: settings.clangTidyFixNotes,
14411441
clangTidyChecksEnabled: settings.clangTidyChecksEnabled,
14421442
clangTidyChecksDisabled: settings.clangTidyChecksDisabled,
1443+
markdownInComments: settings.markdownInComments,
14431444
hover: settings.hover,
14441445
vcFormatIndentBraces: settings.vcFormatIndentBraces,
14451446
vcFormatIndentMultiLineRelativeTo: settings.vcFormatIndentMultiLineRelativeTo,

Extension/src/LanguageServer/settings.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import * as nls from 'vscode-nls';
1515
import * as which from 'which';
1616
import { getCachedClangFormatPath, getCachedClangTidyPath, getExtensionFilePath, setCachedClangFormatPath, setCachedClangTidyPath } from '../common';
1717
import { isWindows } from '../constants';
18-
import { cachedEditorConfigLookups, cachedEditorConfigSettings, DefaultClient, hasTrustedCompilerPaths } from './client';
18+
import { DefaultClient, cachedEditorConfigLookups, cachedEditorConfigSettings, hasTrustedCompilerPaths } from './client';
1919
import { clients } from './extension';
2020
import { CommentPattern } from './languageConfig';
2121
import { PersistentState } from './persistentState';
@@ -63,6 +63,7 @@ export interface WorkspaceFolderSettingsParams {
6363
clangTidyChecksEnabled: string[] | undefined;
6464
clangTidyChecksDisabled: string[] | undefined;
6565
hover: string | undefined;
66+
markdownInComments: string | undefined;
6667
vcFormatIndentBraces: boolean | undefined;
6768
vcFormatIndentMultiLineRelativeTo: string | undefined;
6869
vcFormatIndentWithinParentheses: string | undefined;
@@ -423,6 +424,7 @@ export class CppSettings extends Settings {
423424
public get caseSensitiveFileSupport(): boolean { return !isWindows || super.Section.get<string>("caseSensitiveFileSupport") === "enabled"; }
424425
public get doxygenSectionTags(): string[] | undefined { return super.Section.get<string[]>("doxygen.sectionTags"); }
425426
public get hover(): string | undefined { return super.Section.get<string>("hover"); }
427+
public get markdownInComments(): string | undefined { return super.Section.get<string>("markdownInComments"); }
426428
public get legacyCompilerArgsBehavior(): boolean | undefined { return super.Section.get<boolean>("legacyCompilerArgsBehavior"); }
427429

428430
public get inlayHintsAutoDeclarationTypes(): boolean {

0 commit comments

Comments
 (0)