Skip to content

Commit

Permalink
tweak settings for language detection
Browse files Browse the repository at this point in the history
  • Loading branch information
spgennard committed Aug 4, 2024
1 parent 23dc465 commit 48cf85b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
27 changes: 26 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,12 @@
]
},
"configurationDefaults": {
"workbench.editor.languageDetectionHints": {
"untitledEditors": true,
"notebookEditors": true
},
"workbench.editor.empty.hint": "text",
"workbench.editor.languageDetection": true,
"workbench.editor.untitled.labelFormat": "name",
"explorer.fileNesting.patterns": {
"*.ts": "${capture}.js",
Expand All @@ -1244,7 +1250,6 @@
"*.COB": "MFU*$(basename).cpy,Test$(basename).cpy"
},
"explorer.fileNesting.enabled": true,
"files.defaultLanguage": "COBOL",
"microFocusCOBOL.suppressFileAssociationsPrompt": true,
"github.copilot.inlineSuggest.enable": true,
"github.copilot.editor.enableAutoCompletions": true,
Expand Down Expand Up @@ -1281,6 +1286,7 @@
"editor.wordSeparators": "`~!@$%^&*()=+[{]}\\|;:'\",.<>/?"
},
"[BITLANG-COBOL]": {
"workbench.editor.languageDetection": false,
"editor.semanticHighlighting.enabled": true,
"editor.bracketPairColorization.enabled": false,
"files.autoGuessEncoding": false,
Expand All @@ -1300,6 +1306,25 @@
"editor.wordSeparators": "`~!@$%^&*()=+[{]}\\|;:'\",.<>/?"
},
"[ACUCOBOL]": {
"workbench.editor.languageDetection": false,
"coboleditor.linter": true,
"editor.semanticHighlighting.enabled": true,
"editor.bracketPairColorization.enabled": false,
"editor.insertSpaces": true,
"editor.guides.indentation": false,
"files.autoGuessEncoding": false,
"editor.autoIndent": "full",
"editor.formatOnType": false,
"editor.rulers": [
6,
7,
72
],
"editor.detectIndentation": false,
"editor.wordSeparators": "`~!#$%^&*()=+[{]}\\|;:'\",.<>/?"
},
"[RMCOBOL]": {
"workbench.editor.languageDetection": false,
"coboleditor.linter": true,
"editor.semanticHighlighting.enabled": true,
"editor.bracketPairColorization.enabled": false,
Expand Down
19 changes: 17 additions & 2 deletions src/vscommon_commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,16 @@ export function activateCommonCommands(context: vscode.ExtensionContext, setting
COBOLUtils.enforceFileExtensions(settings, act, VSExternalFeatures, true, "ACUCOBOL");
}));

context.subscriptions.push(commands.registerCommand("cobolplugin.change_lang_to_rmcobol", function () {
const act = vscode.window.activeTextEditor;
if (act === null || act === undefined) {
return;
}

vscode.languages.setTextDocumentLanguage(act.document, "RMCOBOL");
COBOLUtils.enforceFileExtensions(settings, act, VSExternalFeatures, true, "RMCOBOL");
}));

context.subscriptions.push(commands.registerCommand("cobolplugin.change_lang_to_cobol", async function () {
const act = vscode.window.activeTextEditor;
if (act === null || act === undefined) {
Expand Down Expand Up @@ -513,17 +523,22 @@ export function activateCommonCommands(context: vscode.ExtensionContext, setting
case "ACUCOBOL":
context.subscriptions.push(getLangStatusItem("Switch to COBOL", "cobolplugin.change_lang_to_cobol", "Change", settings, langid + "_2", langid));
break;
case "BITLANG-COBOL":
case "COBOL":
{
context.subscriptions.push(getLangStatusItem("Switch to ACUCOBOL", "cobolplugin.change_lang_to_acu", "Change", settings, langid + "_3", langid));

if (mfExt !== undefined) {
context.subscriptions.push(getLangStatusItem("Switch to 'Micro Focus COBOL'", "cobolplugin.change_lang_to_mfcobol", "Change", settings, langid + "_5", langid));
context.subscriptions.push(getLangStatusItem("Switch to 'Micro Focus COBOL'", "cobolplugin.change_lang_to_mfcobol", "Change", settings, langid + "_6", langid));
}
}
break;
case "RMCOBOL":
context.subscriptions.push(getLangStatusItem("Switch to ACUCOBOL", "cobolplugin.change_lang_to_acu", "Change", settings, langid + "_2", langid));
context.subscriptions.push(getLangStatusItem("Switch to COBOL", "cobolplugin.change_lang_to_cobol", "Change", settings, langid + "_5", langid));
break;
case ExtensionDefaults.microFocusCOBOLLanguageId:
context.subscriptions.push(getLangStatusItem("Switch to 'BitLang COBOL'", "cobolplugin.change_lang_to_cobol", "Change", settings, langid + "_4", langid));
context.subscriptions.push(getLangStatusItem("Switch to 'BitLang COBOL'", "cobolplugin.change_lang_to_cobol", "Change", settings, langid + "_6", langid));
break;
}

Expand Down

0 comments on commit 48cf85b

Please sign in to comment.