Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/10545.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Enable Shortcuts to Comment Lines in Query Editor ([#10545](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/10545))
1 change: 1 addition & 0 deletions packages/osd-monaco/src/monaco.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ import 'monaco-editor/esm/vs/editor/contrib/suggest/browser/suggestController';
import 'monaco-editor/esm/vs/editor/contrib/hover/browser/hoverContribution'; // For hover
import 'monaco-editor/esm/vs/editor/contrib/parameterHints/browser/parameterHints'; // For parameter hints
import 'monaco-editor/esm/vs/editor/contrib/format/browser/formatActions'; // For document formatting
import 'monaco-editor/esm/vs/editor/contrib/comment/browser/comment'; // For comment/uncomment support

export { monaco };
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ const languageConfiguration: LanguageConfiguration = {
{ open: "'", close: "'" },
{ open: '`', close: '`' },
],
comments: {
lineComment: '//', // line comment
blockComment: ['/*', '*/'], // block comment
},
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you see if there was a test that checks for these other stuff? if there was, might be worth adding this one too so that test fails if someone does something to it by accidently in the future

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is a test for it right now. We can add a cypress test for it.

wordPattern: /@?\w[\w@'.-]*[?!,;:"]*/, // Consider tokens containing . @ as words while applying suggestions. Refer https://github.com/opensearch-project/OpenSearch-Dashboards/pull/10118#discussion_r2201428532 for details.
};

Expand Down
Loading