mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 22:02:55 +01:00
Merge branch 'main' into patch-1
This commit is contained in:
commit
84f1394f75
5 changed files with 119 additions and 4 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -5,7 +5,7 @@ on: [push, pull_request]
|
|||
jobs:
|
||||
build:
|
||||
name: CI
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ const keywordsSet = new Set();
|
|||
|
||||
addArrToSet(keywordsSet, getMicrosoftSQLKeywords());
|
||||
addArrToSet(keywordsSet, getSQLiteKeywords());
|
||||
addArrToSet(keywordsSet, getSnowflakeSQLKeywords());
|
||||
|
||||
const keywords = setToArr(keywordsSet);
|
||||
keywords.sort();
|
||||
|
|
@ -610,3 +611,104 @@ function getSQLiteKeywords() {
|
|||
.map((t) => t.trim())
|
||||
.filter((t) => !!t);
|
||||
}
|
||||
|
||||
function getSnowflakeSQLKeywords() {
|
||||
// https://docs.snowflake.com/en/sql-reference/reserved-keywords
|
||||
return `
|
||||
ACCOUNT
|
||||
ALL
|
||||
ALTER
|
||||
AND
|
||||
ANY
|
||||
AS
|
||||
BETWEEN
|
||||
BY
|
||||
CASE
|
||||
CAST
|
||||
CHECK
|
||||
COLUMN
|
||||
CONNECT
|
||||
CONNECTION
|
||||
CONSTRAINT
|
||||
CREATE
|
||||
CROSS
|
||||
CURRENT
|
||||
CURRENT_DATE
|
||||
CURRENT_TIME
|
||||
CURRENT_TIMESTAMP
|
||||
CURRENT_USER
|
||||
DATABASE
|
||||
DELETE
|
||||
DISTINCT
|
||||
DROP
|
||||
ELSE
|
||||
EXISTS
|
||||
FALSE
|
||||
FOLLOWING
|
||||
FOR
|
||||
FROM
|
||||
FULL
|
||||
GRANT
|
||||
GROUP
|
||||
GSCLUSTER
|
||||
HAVING
|
||||
ILIKE
|
||||
IN
|
||||
INCREMENT
|
||||
INNER
|
||||
INSERT
|
||||
INTERSECT
|
||||
INTO
|
||||
IS
|
||||
ISSUE
|
||||
JOIN
|
||||
LATERAL
|
||||
LEFT
|
||||
LIKE
|
||||
LOCALTIME
|
||||
LOCALTIMESTAMP
|
||||
MINUS
|
||||
NATURAL
|
||||
NOT
|
||||
NULL
|
||||
OF
|
||||
ON
|
||||
OR
|
||||
ORDER
|
||||
ORGANIZATION
|
||||
QUALIFY
|
||||
REGEXP
|
||||
REVOKE
|
||||
RIGHT
|
||||
RLIKE
|
||||
ROW
|
||||
ROWS
|
||||
SAMPLE
|
||||
SCHEMA
|
||||
SELECT
|
||||
SET
|
||||
SOME
|
||||
START
|
||||
TABLE
|
||||
TABLESAMPLE
|
||||
THEN
|
||||
TO
|
||||
TRIGGER
|
||||
TRUE
|
||||
TRY_CAST
|
||||
UNION
|
||||
UNIQUE
|
||||
UPDATE
|
||||
USING
|
||||
VALUES
|
||||
VIEW
|
||||
WHEN
|
||||
WHENEVER
|
||||
WHERE
|
||||
WINDOW
|
||||
WITH
|
||||
`
|
||||
.split(/\r\n|\r|\n/)
|
||||
.map((t) => t.trim())
|
||||
.filter((t) => !!t);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "monaco-editor-webpack-plugin",
|
||||
"version": "7.1.0",
|
||||
"version": "7.1.1",
|
||||
"description": "A webpack plugin for the Monaco Editor",
|
||||
"main": "out/index.js",
|
||||
"typings": "./out/index.d.ts",
|
||||
|
|
|
|||
|
|
@ -296,7 +296,14 @@ function createLoaderRules(
|
|||
if(/^(\\/\\/)/.test(result)) {
|
||||
result = window.location.protocol + result
|
||||
}
|
||||
var js = '/*' + label + '*/importScripts("' + result + '");';
|
||||
var js = '/*' + label + '*/';
|
||||
if (typeof import.meta !== 'undefined') {
|
||||
// module worker
|
||||
js += 'import "' + result + '";';
|
||||
} else {
|
||||
// classic worker
|
||||
js += 'importScripts("' + result + '");';
|
||||
}
|
||||
var blob = new Blob([js], { type: 'application/javascript' });
|
||||
return URL.createObjectURL(blob);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import { Preview } from "./Preview";
|
|||
import { SettingsDialog } from "./SettingsDialog";
|
||||
import { getNpmVersionsSync } from "./getNpmVersionsSync";
|
||||
import { PlaygroundExample, getPlaygroundExamples } from "./playgroundExamples";
|
||||
import { getDefaultSettings, toLoaderConfig } from "./SettingsModel";
|
||||
|
||||
@hotComponent(module)
|
||||
@observer
|
||||
|
|
@ -85,6 +84,7 @@ export class PlaygroundPageContent extends React.Component<
|
|||
}
|
||||
>
|
||||
<Editor
|
||||
label="JavaScript Input"
|
||||
language={"javascript"}
|
||||
value={ref(model, "js")}
|
||||
/>
|
||||
|
|
@ -94,6 +94,7 @@ export class PlaygroundPageContent extends React.Component<
|
|||
<div>
|
||||
<LabeledEditor label="HTML">
|
||||
<Editor
|
||||
label="HTML Input"
|
||||
height={{
|
||||
kind: "dynamic",
|
||||
maxHeight: 200,
|
||||
|
|
@ -107,6 +108,7 @@ export class PlaygroundPageContent extends React.Component<
|
|||
<div>
|
||||
<LabeledEditor label="CSS">
|
||||
<Editor
|
||||
label="CSS Input"
|
||||
height={{
|
||||
kind: "dynamic",
|
||||
maxHeight: 200,
|
||||
|
|
@ -480,6 +482,7 @@ class Editor extends React.Component<{
|
|||
language: string;
|
||||
value: IReference<string>;
|
||||
height?: MonacoEditorHeight;
|
||||
label: string;
|
||||
}> {
|
||||
private editor: monaco.editor.IStandaloneCodeEditor | undefined = undefined;
|
||||
private disposables: monaco.IDisposable[] = [];
|
||||
|
|
@ -504,6 +507,9 @@ class Editor extends React.Component<{
|
|||
|
||||
initializeEditor(editor: monaco.editor.IStandaloneCodeEditor) {
|
||||
this.editor = editor;
|
||||
editor.updateOptions({
|
||||
ariaLabel: this.props.label,
|
||||
});
|
||||
this.disposables.push(this.editor);
|
||||
this.disposables.push(
|
||||
this.editor.onDidChangeModelContent((e) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue