From e78451d58ef72abff5e55d11c1178179efd8e1b9 Mon Sep 17 00:00:00 2001 From: Stephen Sigwart Date: Sat, 6 Nov 2021 10:25:07 -0400 Subject: [PATCH 0001/1435] Fix unexpected tab completion when attempting to indent --- src/vs/editor/contrib/suggest/browser/wordContextKey.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/suggest/browser/wordContextKey.ts b/src/vs/editor/contrib/suggest/browser/wordContextKey.ts index ae8fd6e1a2da..968e3a9ab289 100644 --- a/src/vs/editor/contrib/suggest/browser/wordContextKey.ts +++ b/src/vs/editor/contrib/suggest/browser/wordContextKey.ts @@ -55,7 +55,7 @@ export class WordContextKey { this._ckAtEnd.set(false); return; } - this._ckAtEnd.set(word.endColumn === selection.getStartPosition().column); + this._ckAtEnd.set(word.endColumn === selection.getStartPosition().column && selection.getStartPosition().lineNumber === selection.getEndPosition().lineNumber); }; this._selectionListener = this._editor.onDidChangeCursorSelection(checkForWordEnd); checkForWordEnd(); From 67c1c57e8291106da4c0b330765083440588c8c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pouya=20Kary=20=E2=9C=A8?= Date: Wed, 10 Apr 2024 00:40:17 +0330 Subject: [PATCH 0002/1435] Adds the section header Mark sign. --- src/vs/editor/common/config/editorOptions.ts | 12 ++++++++++++ src/vs/monaco.d.ts | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index fab223456feb..5c1a16162a39 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -3071,6 +3071,11 @@ export interface IEditorMinimapOptions { * Font size of section headers. Defaults to 9. */ sectionHeaderFontSize?: number; + + /** + * The sign that is interpreted as a mark, Defaults to `MARK:` + */ + sectionHeaderMarkSign?: string; } /** @@ -3093,6 +3098,7 @@ class EditorMinimap extends BaseEditorOption Date: Sat, 13 Apr 2024 01:16:06 +0330 Subject: [PATCH 0003/1435] implement custom section header templates --- .vscode/bookmarks.json | 24 ++++++++++++ src/vs/editor/common/config/editorOptions.ts | 38 +++++++++++++------ .../common/services/findSectionHeaders.ts | 14 +++---- .../sectionHeaders/browser/sectionHeaders.ts | 1 + src/vs/monaco.d.ts | 9 +++-- 5 files changed, 64 insertions(+), 22 deletions(-) create mode 100644 .vscode/bookmarks.json diff --git a/.vscode/bookmarks.json b/.vscode/bookmarks.json new file mode 100644 index 000000000000..901c7b44cf94 --- /dev/null +++ b/.vscode/bookmarks.json @@ -0,0 +1,24 @@ +{ + "files": [ + { + "path": "src/vs/editor/common/services/findSectionHeaders.ts", + "bookmarks": [ + { + "line": 48, + "column": 34, + "label": "Where section headers are parsed" + } + ] + }, + { + "path": "src/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.ts", + "bookmarks": [ + { + "line": 108, + "column": 10, + "label": "Where options are created" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 5c1a16162a39..07239451e85f 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -3067,15 +3067,17 @@ export interface IEditorMinimapOptions { * Whether to show MARK: comments as section headers. Defaults to true. */ showMarkSectionHeaders?: boolean; + /** - * Font size of section headers. Defaults to 9. + * When specified, is used to create a custom section header parser regexp. + * It must contain a match group that detects the header */ - sectionHeaderFontSize?: number; + sectionHeaderTemplateRegExp?: string; /** - * The sign that is interpreted as a mark, Defaults to `MARK:` + * Font size of section headers. Defaults to 9. */ - sectionHeaderMarkSign?: string; + sectionHeaderFontSize?: number; } /** @@ -3097,8 +3099,8 @@ class EditorMinimap extends BaseEditorOption Date: Sat, 13 Apr 2024 11:55:18 +0330 Subject: [PATCH 0004/1435] remove accidental bookmark inclusion --- .vscode/bookmarks.json | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .vscode/bookmarks.json diff --git a/.vscode/bookmarks.json b/.vscode/bookmarks.json deleted file mode 100644 index 901c7b44cf94..000000000000 --- a/.vscode/bookmarks.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "files": [ - { - "path": "src/vs/editor/common/services/findSectionHeaders.ts", - "bookmarks": [ - { - "line": 48, - "column": 34, - "label": "Where section headers are parsed" - } - ] - }, - { - "path": "src/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.ts", - "bookmarks": [ - { - "line": 108, - "column": 10, - "label": "Where options are created" - } - ] - } - ] -} \ No newline at end of file From b8a138368d1f21a876c060663bab316291f5cc69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pouya=20Kary=20=E2=9C=A8?= Date: Sat, 13 Apr 2024 11:58:50 +0330 Subject: [PATCH 0005/1435] add default value for sectionHeaderTemplateRegExp in tests --- src/vs/editor/test/browser/config/editorLayoutProvider.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/test/browser/config/editorLayoutProvider.test.ts b/src/vs/editor/test/browser/config/editorLayoutProvider.test.ts index 4f644203ef43..e5076dce6134 100644 --- a/src/vs/editor/test/browser/config/editorLayoutProvider.test.ts +++ b/src/vs/editor/test/browser/config/editorLayoutProvider.test.ts @@ -60,7 +60,8 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => { scale: 1, showRegionSectionHeaders: true, showMarkSectionHeaders: true, - sectionHeaderFontSize: 9 + sectionHeaderFontSize: 9, + sectionHeaderTemplateRegExp: '\\bMARK:\\s*(.*)$', }; options._write(EditorOption.minimap, minimapOptions); const scrollbarOptions: InternalEditorScrollbarOptions = { From 69b655c986302161688115f6b4055b7e31bd9ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pouya=20Kary=20=E2=9C=A8?= Date: Sat, 13 Apr 2024 12:13:09 +0330 Subject: [PATCH 0006/1435] rename sectionHeaderTemplateRegExp to sectionHeaderDetectionRegExp --- src/vs/editor/common/config/editorOptions.ts | 20 +++++++++---------- .../common/services/findSectionHeaders.ts | 6 +++--- .../sectionHeaders/browser/sectionHeaders.ts | 2 +- .../config/editorLayoutProvider.test.ts | 2 +- src/vs/monaco.d.ts | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 07239451e85f..d39d58b37636 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -3072,7 +3072,7 @@ export interface IEditorMinimapOptions { * When specified, is used to create a custom section header parser regexp. * It must contain a match group that detects the header */ - sectionHeaderTemplateRegExp?: string; + sectionHeaderDetectionRegExp?: string; /** * Font size of section headers. Defaults to 9. @@ -3099,7 +3099,7 @@ class EditorMinimap extends BaseEditorOption { showRegionSectionHeaders: true, showMarkSectionHeaders: true, sectionHeaderFontSize: 9, - sectionHeaderTemplateRegExp: '\\bMARK:\\s*(.*)$', + sectionHeaderDetectionRegExp: '\\bMARK:\\s*(.*)$', }; options._write(EditorOption.minimap, minimapOptions); const scrollbarOptions: InternalEditorScrollbarOptions = { diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 252806b10506..a23696da9f53 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -4318,7 +4318,7 @@ declare namespace monaco.editor { * When specified, is used to create a custom section header parser regexp. * It must contain a match group that detects the header */ - sectionHeaderTemplateRegExp?: string; + sectionHeaderDetectionRegExp?: string; /** * Font size of section headers. Defaults to 9. */ From 2631429022b3641eff410f3c0e9e77f63a1125b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pouya=20Kary=20=E2=9C=A8?= Date: Sat, 13 Apr 2024 15:24:29 +0330 Subject: [PATCH 0007/1435] add label regexp matches for both label and separator templates --- src/vs/editor/common/config/editorOptions.ts | 4 ++-- src/vs/editor/common/services/findSectionHeaders.ts | 7 ++++++- .../contrib/sectionHeaders/browser/sectionHeaders.ts | 2 +- .../test/browser/config/editorLayoutProvider.test.ts | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index d39d58b37636..9a07da620b25 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -3099,7 +3099,7 @@ class EditorMinimap extends BaseEditorOption\-?)\\s*(?