mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 13:55:41 +01:00
Merge branch 'main' into feature/bump-vscode-json-languageservice
This commit is contained in:
commit
463a7bfb7d
67 changed files with 57477 additions and 30199 deletions
|
|
@ -44,10 +44,12 @@ parameters:
|
|||
extends:
|
||||
template: azure-pipelines/npm-package/pipeline.yml@templates
|
||||
parameters:
|
||||
cgIgnoreDirectories: $(Build.SourcesDirectory)/dependencies/vscode
|
||||
npmPackages:
|
||||
- name: monaco-editor-core
|
||||
workingDirectory: $(Build.SourcesDirectory)/dependencies/vscode/out-monaco-editor-core
|
||||
testPlatforms: []
|
||||
skipAPIScan: true # package build requires Linux
|
||||
buildSteps:
|
||||
- script: sudo apt install -y libkrb5-dev
|
||||
displayName: Install libkrb5-dev
|
||||
|
|
@ -68,8 +70,10 @@ extends:
|
|||
publishRequiresApproval: false
|
||||
|
||||
- name: monaco-editor
|
||||
dependsOn: monaco-editor-core
|
||||
workingDirectory: $(Build.SourcesDirectory)/out/monaco-editor
|
||||
testPlatforms: []
|
||||
skipAPIScan: true # package build requires Linux
|
||||
buildSteps:
|
||||
- script: npm ci
|
||||
displayName: Install NPM dependencies
|
||||
|
|
|
|||
|
|
@ -32,10 +32,12 @@ parameters:
|
|||
extends:
|
||||
template: azure-pipelines/npm-package/pipeline.yml@templates
|
||||
parameters:
|
||||
cgIgnoreDirectories: $(Build.SourcesDirectory)/dependencies/vscode
|
||||
npmPackages:
|
||||
- name: monaco-editor-core
|
||||
workingDirectory: $(Build.SourcesDirectory)/dependencies/vscode/out-monaco-editor-core
|
||||
testPlatforms: []
|
||||
skipAPIScan: true # package build requires Linux
|
||||
buildSteps:
|
||||
- script: sudo apt install -y libkrb5-dev
|
||||
displayName: Install libkrb5-dev
|
||||
|
|
@ -52,8 +54,10 @@ extends:
|
|||
publishRequiresApproval: false
|
||||
|
||||
- name: monaco-editor
|
||||
dependsOn: monaco-editor-core
|
||||
workingDirectory: $(Build.SourcesDirectory)/out/monaco-editor
|
||||
testPlatforms: []
|
||||
skipAPIScan: true # package build requires Linux
|
||||
buildSteps:
|
||||
- script: npm ci
|
||||
displayName: Install NPM dependencies
|
||||
|
|
@ -66,8 +70,10 @@ extends:
|
|||
publishRequiresApproval: false
|
||||
|
||||
- name: monaco-editor-webpack-plugin
|
||||
dependsOn: monaco-editor
|
||||
workingDirectory: $(Build.SourcesDirectory)/webpack-plugin
|
||||
testPlatforms: []
|
||||
packagePlatform: Windows
|
||||
buildSteps:
|
||||
- script: npm ci
|
||||
displayName: Install NPM dependencies
|
||||
|
|
|
|||
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
|
|
@ -56,8 +56,9 @@ jobs:
|
|||
- name: Package using vite
|
||||
run: npm run package-for-smoketest-vite
|
||||
|
||||
- name: Package using parcel
|
||||
run: npm run package-for-smoketest-parcel --prefix test/smoke/parcel
|
||||
# - name: Package using parcel
|
||||
# run: npm run package-for-smoketest-parcel --prefix test/smoke/parcel
|
||||
# Disabled for now, as the parcel bundler cannot deal with VS Code process variable
|
||||
|
||||
- name: Run smoke test
|
||||
run: npm run smoketest
|
||||
|
|
|
|||
29
.github/workflows/info-needed-closer.yml
vendored
29
.github/workflows/info-needed-closer.yml
vendored
|
|
@ -1,29 +0,0 @@
|
|||
name: Info Needed Closer
|
||||
on:
|
||||
schedule:
|
||||
- cron: 20 12 * * * # 5:20am Redmond
|
||||
repository_dispatch:
|
||||
types: [trigger-needs-more-info]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'microsoft/vscode-github-triage-actions'
|
||||
path: ./actions
|
||||
ref: stable
|
||||
- name: Install Actions
|
||||
run: npm install --production --prefix ./actions
|
||||
- name: Run Info Needed Closer
|
||||
uses: ./actions/needs-more-info-closer
|
||||
with:
|
||||
label: info-needed
|
||||
closeDays: 7
|
||||
additionalTeam: 'spahnke|rcjsuen'
|
||||
closeComment: "This issue has been closed automatically because it needs more information and has not had recent activity. See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!"
|
||||
pingDays: 120
|
||||
pingComment: "Hey @${assignee}, this issue might need further attention.\n\n@${author}, you can help us out by closing this issue if the problem no longer exists, or adding more information."
|
||||
27
.github/workflows/locker.yml
vendored
27
.github/workflows/locker.yml
vendored
|
|
@ -1,27 +0,0 @@
|
|||
name: Locker
|
||||
on:
|
||||
schedule:
|
||||
- cron: 21 23 * * * # 5:20pm Redmond
|
||||
repository_dispatch:
|
||||
types: [trigger-locker]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'microsoft/vscode-github-triage-actions'
|
||||
path: ./actions
|
||||
ref: stable
|
||||
- name: Install Actions
|
||||
run: npm install --production --prefix ./actions
|
||||
- name: Run Locker
|
||||
uses: ./actions/locker
|
||||
with:
|
||||
daysSinceClose: 45
|
||||
appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}}
|
||||
daysSinceUpdate: 3
|
||||
ignoredLabel: '*out-of-scope'
|
||||
2
.nvmrc
2
.nvmrc
|
|
@ -1 +1 @@
|
|||
18.17
|
||||
20.14.0
|
||||
|
|
|
|||
13
.vscode/launch.json
vendored
13
.vscode/launch.json
vendored
|
|
@ -5,7 +5,7 @@
|
|||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Monaco Editor Playground",
|
||||
"name": "Monaco Editor Playground (Languages from source, needs 'npm run watch', no JSON/CSS/... workers!)",
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"url": "https://microsoft.github.io/monaco-editor/playground.html?sourceLanguages=http%3A%2F%2Flocalhost%3A5002%2Fout%2Flanguages%2Famd-tsc",
|
||||
|
|
@ -15,6 +15,17 @@
|
|||
"order": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Monaco Editor Playground (Languages locally bundled, needs 'npm run build')",
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"url": "https://microsoft.github.io/monaco-editor/playground.html?sourceLanguages=http%3A%2F%2Flocalhost%3A5002%2Fout%2Flanguages%2Fbundled%2Famd-dev%2Fvs",
|
||||
"preLaunchTask": "Launch Http Server",
|
||||
"presentation": {
|
||||
"group": "monaco",
|
||||
"order": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Website",
|
||||
"type": "chrome",
|
||||
|
|
|
|||
68
CHANGELOG.md
68
CHANGELOG.md
|
|
@ -1,5 +1,73 @@
|
|||
# Monaco Editor Changelog
|
||||
|
||||
## [0.52.0]
|
||||
|
||||
- Comment added inside of `IModelContentChangedEvent`
|
||||
|
||||
## [0.51.0]
|
||||
|
||||
- New fields `IEditorOptions.placeholder` and `IEditorOptions.compactMode`
|
||||
- New fields `IGotoLocationOptions.multipleTests` and `IGotoLocationOptions.alternativeTestsCommand`
|
||||
- New field `IInlineEditOptions.backgroundColoring`
|
||||
- New experimental field `IEditorOptions.experimental.useTrueInlineView`
|
||||
- New options `CommentThreadRevealOptions` for comments
|
||||
|
||||
Contributions to `monaco-editor`:
|
||||
|
||||
- [@ScottCarda-MS (Scott Carda)](https://github.com/ScottCarda-MS): Update Q# Keywords [PR #4586](https://github.com/microsoft/monaco-editor/pull/4586)
|
||||
|
||||
## [0.50.0]
|
||||
|
||||
- New field `IEditorMinimapOptions.sectionHeaderLetterSpacing`
|
||||
- New field `IOverlayWidgetPosition.stackOridinal`
|
||||
- New field `EmitOutput.diagnostics`
|
||||
- New event `IOverlayWidget.onDidLayout`
|
||||
- New events `ICodeEditor.onBeginUpdate` and `ICodeEditor.onEndUpdate`
|
||||
- `HoverVerbosityRequest.action` -> `HoverVerbosityRequest.verbosityDelta`
|
||||
- `MultiDocumentHighlightProvider.selector` changed from `LanguageFilter` to `LanguageSelector`
|
||||
- New optional parameters in `getEmitOutput`: `emitOnlyDtsFiles` and `forceDtsEmit`
|
||||
|
||||
Contributions to `monaco-editor`:
|
||||
|
||||
- [@htcfreek (Heiko)](https://github.com/htcfreek): Add extension to `csp.contribution.ts` [PR #4504](https://github.com/microsoft/monaco-editor/pull/4504)
|
||||
- [@jakebailey (Jake Bailey)](https://github.com/jakebailey): Call clearFiles on internal EmitOutput diagnostics, pass args down [PR #4482](https://github.com/microsoft/monaco-editor/pull/4482)
|
||||
- [@johnyanarella (John Yanarella)](https://github.com/johnyanarella): Update TypeScript to TS 5.4.5 in all projects, vendored files [PR #4305](https://github.com/microsoft/monaco-editor/pull/4305)
|
||||
- [@samstrohkorbatt](https://github.com/samstrohkorbatt): Adding Python f-string syntax support [PR #4401](https://github.com/microsoft/monaco-editor/pull/4401)
|
||||
|
||||
## [0.49.0]
|
||||
|
||||
- New proposed `editorHoverVerbosityLevel` API
|
||||
- New proposed `newSymbolNamesProvider` API
|
||||
|
||||
Contributions to `monaco-editor`:
|
||||
|
||||
- [@timotheeguerin (Timothee Guerin)](https://github.com/timotheeguerin): Add support for TypeSpec language [PR #4450](https://github.com/microsoft/monaco-editor/pull/4450)
|
||||
|
||||
## [0.48.0]
|
||||
|
||||
### Additions
|
||||
|
||||
- Various bug fixes
|
||||
- Minimap Section Headers (see config option `showRegionSectionHeaders`)
|
||||
- Diff Editor Gutter Menu (see config option `renderGutterMenu`)
|
||||
- `InlineCompletionsProvider.handlePartialAccept` has `PartialAcceptInfo`
|
||||
|
||||
Contributions to `monaco-editor`:
|
||||
|
||||
- [@jeremy-rifkin (Jeremy Rifkin)](https://github.com/jeremy-rifkin): Fix bug with highlighting of C++ raw string literals [PR #4436](https://github.com/microsoft/monaco-editor/pull/4436)
|
||||
|
||||
## [0.47.0]
|
||||
|
||||
### Additions
|
||||
|
||||
- Bug fixes
|
||||
- `registerNewSymbolNameProvider`
|
||||
- Experimental `registerInlineEditProvider`
|
||||
|
||||
## [0.46.0]
|
||||
|
||||
- Bug fixes
|
||||
|
||||
## [0.45.0]
|
||||
|
||||
### Breaking Changes
|
||||
|
|
|
|||
|
|
@ -8,18 +8,26 @@ Make sure every unassigned issue is labeled properly:
|
|||
|
||||
## Publishing a stable build monaco-editor build
|
||||
|
||||
- Make sure there exists a nightly build from the VS Code commit the stable build should be built from
|
||||
- [Compare Last Stable With Nightly](https://microsoft.github.io/monaco-editor/playground.html?source=v0.40.0-dev.20230704#XQAAAAJWBgAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw_SM66BuzMt6m3zM8Thvb-XSMR_Da8IdBq3FOgly-7-xuaHSi_yUg58ZO9Mr-RKT7GyHzHoU8B9N7P-uTzmCdhT2Vv-4gNRbWSMQCUPrfmzFCkSH_WR2Vc8LGx2m0uRSFiJu82B1mS0RM-eriU9PTOqAgBrlPUMTU44VrHyVOqgs5BFrUuUHwGDzUHxeNuUk-kg2u70awQLQ83wD4o2EbSefqfIWkk2Yi0mnUS903tLA4V17MD_6OHIRArunMPL6E14ZCW0_Aql21F62Fmz--i_pNbqBIpSlBbZl6LzA1HzNsoDH7i2rn1qAw55L1MjwOU4QQMCJfffmJznAbGoZWkXK91OPYlOGNHNGG-MPUFsY5JSjLfvCWOvXypW9ZVkBZMo1qUbtE135CLqbaBiw52f3eOPBTru3IL_wT__ciAFI5NDiVOeN8V9zqkzbwiFNeQyZcjxmrDLjYTPJpao0dG61Um0w4FpVud8p77bjoAdEfG8JNO97W4cawj0HvMfvcZS81P7IsijZqA7KyVsdq79iCJQuMO31aS86cM4GTNT0TvdI7p62uiEmm9X6ZjF8oSLxW87Vt0oYAZ5wBePqdN6FwNO6BWACt2Ep9i5Q6h-mOy7_JWOiPTOH0Zz3v6SaNhjxJwZAqNG3FqvRTgLg-au-pfa8PD0No3U15UyWeqrVXSthGFghLJ16ppEwFCqFfQ6Vr0leZtSZXyk41-t5ZKMG-KQjzq1XE2PnuyOz60nV4GaYvGlMHrXz-XrEqb2kwNf_pBee0)
|
||||
- Update [package.json](./package.json)
|
||||
- set `version` to next stable
|
||||
- set `vscodeRef` to _vscodeCommitId_
|
||||
- update `devDependencies.monaco-editor-core` to _version_
|
||||
- Run `npm install` to update lockfile
|
||||
- Update [CHANGELOG.md](./CHANGELOG.md)
|
||||
- API Changes / Breaking Changes / New and noteworthy
|
||||
- Thank you ([use this tool](https://tools.code.visualstudio.com/acknowledgement))
|
||||
- Commit
|
||||
- [Trigger build](https://dev.azure.com/monacotools/Monaco/_build?definitionId=416)
|
||||
- Trigger an rc-build
|
||||
- Go to https://github.com/microsoft/vscode/tree/release/1.89 (use latest VS Code version instead of .89!) and copy the id of the latest commit
|
||||
- Go to https://dev.azure.com/monacotools/Monaco/_build?definitionId=421 and click on "Run pipeline"
|
||||
- Use the copied commit id for `The VS Code commit id.`
|
||||
- Use `rc` for `The prerelease version.`
|
||||
- Wait until pipeline completes
|
||||
- [Compare Last Stable With Nightly](https://microsoft.github.io/monaco-editor/playground.html?source=v0.40.0-dev.20230704#XQAAAAIGBwAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscxAWG5G70rT-mLieOxDi0igaBcv2nRy9q6wT9hrC3N47TPeSd0URO3iwn_firHxVGLm2_8QMEuG2aOJ-jnXkHfLAawVi9XJdfEkOLYHqAT78XFdClh7HNBHFpSfLkCNQ3vE811FAdf6WYL_UK2n1jfGRMcnWqaztoAOTcWNn5qQ9RusryNfDBRqtjOJktItFKSNuOcLg104A0xatH8uXcfAULeE9RZRf41YqC9wbcZDEp7Mnul26YzW_IBv-vL-EGPcEFiu34YZPHQguQiuU8L4VXh7uAtKRWehN9N2m2XFF3yHCBpSGiN8qmBi4HSBRjbhkEKka_icj87t3Lfmg15PMqKgTr7l73XusvkQCZDvqumlN-mcVTZiIdD51m-OFugmn0Cq_ZPU2zq45rRtk1he8PcWiZpPSbCknJsHs4D-mKcc-ypq6CLYlqO8Cvc5lRWzwD-pG6e6uPAQsRAOJ45-mySqhRo_MGJ7aLfkhe7fVn9OvOm6BRsDAYmNVZqpA5aKJzwjeUwQqHwV8CW-b4hrZooiPavu8m2XgbiSW_5nmzbjQ-SaPnBsJxcAewWB_NiYiU3H_Gfhi8K0qQZlBxaetqYX5Ns1Ww6S_By4izRxeEln7McyDQxKk-tnywSCklMhZPiMaR0AZsXs5DQSxGTlB5q61e7Wtxb0RLdk5einYvNwXDooi5Vi5go_ZsO7JYmzylxi-T_hdsPgKNoy6j9IVh5BZb_HgRoaGCrojOWJdYpNNrPJJG_1fyZ8Bk80eYNmHHPJ7Q-pdXqQuAZBdd9Grv4UfXoY1R3Sl529QkIjEHTzgzYGn4C5KE5IGhEfu49Ugy0fFHU-yJGY__aPECJ)
|
||||
- Check the metadata and verify that the last stable is on the left and the the last rc build is on the right
|
||||
- Update [package.json](./package.json)
|
||||
- set `version` to _lastNightly.nextStableVersion_ (from the compare step)
|
||||
- set `vscodeRef` to _lastNightly.vscodeCommitId_
|
||||
- update `devDependencies.monaco-editor-core` to _lastNightly.currentVersion_
|
||||
- Run `npm install` to update lockfile
|
||||
- Update [CHANGELOG.md](./CHANGELOG.md)
|
||||
- API Changes / Breaking Changes / New and noteworthy (use the diff from the compare step)
|
||||
- Add thank you mentions ([use this tool](https://tools.code.visualstudio.com/acknowledgement) and select only the monaco-editor)
|
||||
- Commit & Create PR
|
||||
- [Trigger build](https://dev.azure.com/monacotools/Monaco/_build?definitionId=416) once merged. Tick the following checkboxes:
|
||||
- Publish Monaco Editor Core
|
||||
- Publish Monaco Editor
|
||||
|
||||
#### Publish new webpack plugin
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import path = require('path');
|
||||
import fs = require('fs');
|
||||
import { REPO_ROOT, readFiles, writeFiles, IFile } from '../build/utils';
|
||||
import { REPO_ROOT, readFiles, writeFiles, IFile, readFile } from '../build/utils';
|
||||
import { removeDir } from '../build/fs';
|
||||
import ts = require('typescript');
|
||||
import { generateMetadata } from './releaseMetadata';
|
||||
|
|
@ -66,9 +66,10 @@ generateMetadata();
|
|||
* Release to `dev` or `min`.
|
||||
*/
|
||||
function AMD_releaseOne(type: 'dev' | 'min') {
|
||||
const coreFiles = readFiles(`node_modules/monaco-editor-core/${type}/**/*`, {
|
||||
let coreFiles = readFiles(`node_modules/monaco-editor-core/${type}/**/*`, {
|
||||
base: `node_modules/monaco-editor-core/${type}`
|
||||
});
|
||||
coreFiles = fixNlsFiles(coreFiles);
|
||||
AMD_addPluginContribs(type, coreFiles);
|
||||
writeFiles(coreFiles, `out/monaco-editor/${type}`);
|
||||
|
||||
|
|
@ -79,6 +80,33 @@ function AMD_releaseOne(type: 'dev' | 'min') {
|
|||
writeFiles(pluginFiles, `out/monaco-editor/${type}`);
|
||||
}
|
||||
|
||||
function fixNlsFiles(files: IFile[]): IFile[] {
|
||||
return files.map((f) => {
|
||||
if (!f.path.match(/nls\.messages\.[a-z\-]+\.js/)) {
|
||||
return f;
|
||||
}
|
||||
|
||||
const dirName = path.dirname(f.path);
|
||||
const fileName = path.basename(f.path);
|
||||
|
||||
const newPath = path.join(dirName, 'vs', fileName);
|
||||
let contentStr = f.contents.toString('utf-8');
|
||||
|
||||
contentStr = `
|
||||
define([], function () {
|
||||
${contentStr}
|
||||
});
|
||||
`;
|
||||
|
||||
const newContents = Buffer.from(contentStr, 'utf-8');
|
||||
|
||||
return {
|
||||
path: newPath,
|
||||
contents: newContents
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit editor.main.js:
|
||||
* - rename the AMD module 'vs/editor/editor.main' to 'vs/editor/edcore.main'
|
||||
|
|
@ -96,6 +124,15 @@ function AMD_addPluginContribs(type: 'dev' | 'min', files: IFile[]) {
|
|||
// Rename the AMD module 'vs/editor/editor.main' to 'vs/editor/edcore.main'
|
||||
contents = contents.replace(/"vs\/editor\/editor\.main\"/, '"vs/editor/edcore.main"');
|
||||
|
||||
// This ensures that old nls-plugin configurations are still respected by the new localization solution.
|
||||
const contentPrefixSource = readFile('src/nls-fix.js')
|
||||
.contents.toString('utf-8')
|
||||
.replace(/\r\n|\n/g, ' ');
|
||||
|
||||
// TODO: Instead of adding this source to the header to maintain the source map indices, it should rewrite the sourcemap!
|
||||
const searchValue = 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt';
|
||||
contents = contents.replace(searchValue, searchValue + ' */ ' + contentPrefixSource + ' /*');
|
||||
|
||||
const pluginFiles = readFiles(`out/languages/bundled/amd-${type}/**/monaco.contribution.js`, {
|
||||
base: `out/languages/bundled/amd-${type}`
|
||||
});
|
||||
|
|
|
|||
|
|
@ -268,16 +268,18 @@ export function readFiles(
|
|||
});
|
||||
|
||||
const base = options.base;
|
||||
return files.map((file) => readFile(file, base));
|
||||
}
|
||||
|
||||
export function readFile(file: string, base: string = '') {
|
||||
const baseLength = base === '' ? 0 : base.endsWith('/') ? base.length : base.length + 1;
|
||||
return files.map((file) => {
|
||||
const fullPath = path.join(REPO_ROOT, file);
|
||||
const contents = fs.readFileSync(fullPath);
|
||||
const relativePath = file.substring(baseLength);
|
||||
return {
|
||||
path: relativePath,
|
||||
contents
|
||||
};
|
||||
});
|
||||
const fullPath = path.join(REPO_ROOT, file);
|
||||
const contents = fs.readFileSync(fullPath);
|
||||
const relativePath = file.substring(baseLength);
|
||||
return {
|
||||
path: relativePath,
|
||||
contents
|
||||
};
|
||||
}
|
||||
|
||||
export function writeFiles(files: IFile[], dest: string) {
|
||||
|
|
|
|||
1319
package-lock.json
generated
1319
package-lock.json
generated
File diff suppressed because it is too large
Load diff
24
package.json
24
package.json
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "monaco-editor",
|
||||
"version": "0.45.0",
|
||||
"vscodeRef": "af28b32d7e553898b2a91af498b1fb666fdebe0c",
|
||||
"version": "0.52.0",
|
||||
"vscodeRef": "493330cdc6475247184ea459c66776c3da12cd2d",
|
||||
"private": true,
|
||||
"description": "A browser based code editor",
|
||||
"homepage": "https://github.com/microsoft/monaco-editor",
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
"chai": "^4.3.6",
|
||||
"clean-css": "^5.2.4",
|
||||
"css-loader": "^6.7.1",
|
||||
"esbuild": "^0.14.49",
|
||||
"esbuild": "^0.20.0",
|
||||
"esbuild-plugin-alias": "^0.2.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"glob": "^7.2.0",
|
||||
|
|
@ -52,25 +52,25 @@
|
|||
"jsdom": "^19.0.0",
|
||||
"jsonc-parser": "^3.0.0",
|
||||
"mocha": "^9.2.0",
|
||||
"monaco-editor-core": "0.46.0-dev-20240109",
|
||||
"monaco-editor-core": "0.52.0-rc2",
|
||||
"parcel": "^2.7.0",
|
||||
"pin-github-action": "^1.8.0",
|
||||
"playwright": "^1.32.2",
|
||||
"prettier": "^2.5.1",
|
||||
"pretty-quick": "^3.1.3",
|
||||
"requirejs": "^2.3.6",
|
||||
"requirejs": "^2.3.7",
|
||||
"shelljs": "^0.8.5",
|
||||
"style-loader": "^3.3.1",
|
||||
"terser": "^5.14.2",
|
||||
"ts-node": "^10.6.0",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"vite": "^3.2.8",
|
||||
"vscode-css-languageservice": "5.4.1",
|
||||
"vscode-html-languageservice": "4.2.4",
|
||||
"vscode-json-languageservice": "5.3.7",
|
||||
"vscode-languageserver-textdocument": "^1.0.4",
|
||||
"vscode-languageserver-types": "3.16.0",
|
||||
"vscode-uri": "3.0.3",
|
||||
"vscode-css-languageservice": "6.2.14",
|
||||
"vscode-html-languageservice": "5.2.0",
|
||||
"vscode-json-languageservice": "5.3.11",
|
||||
"vscode-languageserver-textdocument": "^1.0.11",
|
||||
"vscode-languageserver-types": "3.17.5",
|
||||
"vscode-uri": "3.0.8",
|
||||
"webpack": "^5.76.0",
|
||||
"yaserver": "^0.4.0"
|
||||
},
|
||||
|
|
|
|||
16
samples/browser-esm-vite-react/package-lock.json
generated
16
samples/browser-esm-vite-react/package-lock.json
generated
|
|
@ -12,7 +12,7 @@
|
|||
"monaco-editor": "^0.32.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"vite": "^2.9.17"
|
||||
}
|
||||
},
|
||||
|
|
@ -1379,16 +1379,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz",
|
||||
"integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.20"
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
|
|
@ -2319,9 +2319,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz",
|
||||
"integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true
|
||||
},
|
||||
"vite": {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
"@types/react": "^17.0.39",
|
||||
"@types/react-dom": "^17.0.11",
|
||||
"@vitejs/plugin-react": "^1.1.4",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"vite": "^2.9.17"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
var require = { paths: { vs: '../node_modules/monaco-editor/min/vs' } };
|
||||
</script>
|
||||
<script src="../node_modules/monaco-editor/min/vs/loader.js"></script>
|
||||
<script src="../node_modules/monaco-editor/min/vs/editor/editor.main.nls.js"></script>
|
||||
<script src="../node_modules/monaco-editor/min/vs/editor/editor.main.js"></script>
|
||||
|
||||
<script>
|
||||
|
|
|
|||
668
samples/package-lock.json
generated
668
samples/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -20,7 +20,7 @@
|
|||
"style-loader": "^3.3.1",
|
||||
"terser-webpack-plugin": "^5.3.1",
|
||||
"ts-loader": "^9.2.6",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"webpack-cli": "^4.9.2",
|
||||
"webpack-dev-server": "^4.7.4",
|
||||
"webpack": "^5.76.0",
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ npm run package-for-smoketest-esbuild
|
|||
# Package using vite
|
||||
npm run package-for-smoketest-vite
|
||||
# Package using parcel
|
||||
npm run package-for-smoketest-parcel --prefix test/smoke/parcel
|
||||
# npm run package-for-smoketest-parcel --prefix test/smoke/parcel
|
||||
# Disabled for now, as the parcel bundler cannot deal with VS Code process variable
|
||||
|
||||
# Run smoke test
|
||||
npm run smoketest
|
||||
|
|
|
|||
|
|
@ -378,21 +378,9 @@ export const language = <languages.IMonarchLanguage>{
|
|||
],
|
||||
|
||||
raw: [
|
||||
[
|
||||
/(.*)(\))(?:([^ ()\\\t"]*))(\")/,
|
||||
{
|
||||
cases: {
|
||||
'$3==$S2': [
|
||||
'string.raw',
|
||||
'string.raw.end',
|
||||
'string.raw.end',
|
||||
{ token: 'string.raw.end', next: '@pop' }
|
||||
],
|
||||
'@default': ['string.raw', 'string.raw', 'string.raw', 'string.raw']
|
||||
}
|
||||
}
|
||||
],
|
||||
[/.*/, 'string.raw']
|
||||
[/[^)]+/, 'string.raw'],
|
||||
[/\)$S2\"/, { token: 'string.raw.end', next: '@pop' }],
|
||||
[/\)/, 'string.raw']
|
||||
],
|
||||
|
||||
annotation: [
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ declare var require: any;
|
|||
|
||||
registerLanguage({
|
||||
id: 'csp',
|
||||
extensions: [],
|
||||
extensions: ['.csp'],
|
||||
aliases: ['CSP', 'csp'],
|
||||
loader: () => {
|
||||
if (AMD) {
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ import './systemverilog/systemverilog.contribution';
|
|||
import './tcl/tcl.contribution';
|
||||
import './twig/twig.contribution';
|
||||
import './typescript/typescript.contribution';
|
||||
import './typespec/typespec.contribution';
|
||||
import './vb/vb.contribution';
|
||||
import './wgsl/wgsl.contribution';
|
||||
import './xml/xml.contribution';
|
||||
|
|
|
|||
|
|
@ -189,5 +189,69 @@ testTokenization('python', [
|
|||
line: '456.7e-7j',
|
||||
tokens: [{ startIndex: 0, type: 'number.python' }]
|
||||
}
|
||||
],
|
||||
|
||||
// F-Strings
|
||||
[
|
||||
{
|
||||
line: 'f"str {var} str"',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.escape.python' },
|
||||
{ startIndex: 2, type: 'string.python' },
|
||||
{ startIndex: 6, type: 'identifier.python' },
|
||||
{ startIndex: 11, type: 'string.python' },
|
||||
{ startIndex: 15, type: 'string.escape.python' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: `f'''str {var} str'''`,
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.escape.python' },
|
||||
{ startIndex: 4, type: 'string.python' },
|
||||
{ startIndex: 8, type: 'identifier.python' },
|
||||
{ startIndex: 13, type: 'string.python' },
|
||||
{ startIndex: 17, type: 'string.escape.python' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'f"{var:.3f}{var!r}{var=}"',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.escape.python' },
|
||||
{ startIndex: 2, type: 'identifier.python' },
|
||||
{ startIndex: 6, type: 'string.python' },
|
||||
{ startIndex: 10, type: 'identifier.python' },
|
||||
{ startIndex: 15, type: 'string.python' },
|
||||
{ startIndex: 17, type: 'identifier.python' },
|
||||
{ startIndex: 22, type: 'string.python' },
|
||||
{ startIndex: 23, type: 'identifier.python' },
|
||||
{ startIndex: 24, type: 'string.escape.python' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'f"\' " "',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.escape.python' },
|
||||
{ startIndex: 2, type: 'string.python' },
|
||||
{ startIndex: 4, type: 'string.escape.python' },
|
||||
{ startIndex: 5, type: 'white.python' },
|
||||
{ startIndex: 6, type: 'string.escape.python' }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: '"{var}"',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.escape.python' },
|
||||
{ startIndex: 1, type: 'string.python' },
|
||||
{ startIndex: 6, type: 'string.escape.python' }
|
||||
]
|
||||
}
|
||||
]
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -250,10 +250,20 @@ export const language = <languages.IMonarchLanguage>{
|
|||
// Recognize strings, including those broken across lines with \ (but not without)
|
||||
strings: [
|
||||
[/'$/, 'string.escape', '@popall'],
|
||||
[/f'{1,3}/, 'string.escape', '@fStringBody'],
|
||||
[/'/, 'string.escape', '@stringBody'],
|
||||
[/"$/, 'string.escape', '@popall'],
|
||||
[/f"{1,3}/, 'string.escape', '@fDblStringBody'],
|
||||
[/"/, 'string.escape', '@dblStringBody']
|
||||
],
|
||||
fStringBody: [
|
||||
[/[^\\'\{\}]+$/, 'string', '@popall'],
|
||||
[/[^\\'\{\}]+/, 'string'],
|
||||
[/\{[^\}':!=]+/, 'identifier', '@fStringDetail'],
|
||||
[/\\./, 'string'],
|
||||
[/'/, 'string.escape', '@popall'],
|
||||
[/\\$/, 'string']
|
||||
],
|
||||
stringBody: [
|
||||
[/[^\\']+$/, 'string', '@popall'],
|
||||
[/[^\\']+/, 'string'],
|
||||
|
|
@ -261,12 +271,26 @@ export const language = <languages.IMonarchLanguage>{
|
|||
[/'/, 'string.escape', '@popall'],
|
||||
[/\\$/, 'string']
|
||||
],
|
||||
fDblStringBody: [
|
||||
[/[^\\"\{\}]+$/, 'string', '@popall'],
|
||||
[/[^\\"\{\}]+/, 'string'],
|
||||
[/\{[^\}':!=]+/, 'identifier', '@fStringDetail'],
|
||||
[/\\./, 'string'],
|
||||
[/"/, 'string.escape', '@popall'],
|
||||
[/\\$/, 'string']
|
||||
],
|
||||
dblStringBody: [
|
||||
[/[^\\"]+$/, 'string', '@popall'],
|
||||
[/[^\\"]+/, 'string'],
|
||||
[/\\./, 'string'],
|
||||
[/"/, 'string.escape', '@popall'],
|
||||
[/\\$/, 'string']
|
||||
],
|
||||
fStringDetail: [
|
||||
[/[:][^}]+/, 'string'],
|
||||
[/[!][ars]/, 'string'], // only !a, !r, !s are supported by f-strings: https://docs.python.org/3/tutorial/inputoutput.html#formatted-string-literals
|
||||
[/=/, 'string'],
|
||||
[/\}/, 'identifier', '@pop']
|
||||
]
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
testTokenization('qsharp', [
|
||||
// Generated from sample: https://github.com/microsoft/Quantum/blob/main/samples/azure-quantum/parallel-qrng/ParallelQrng.ipynb
|
||||
[
|
||||
{
|
||||
line: 'open Microsoft.Quantum.Arrays;',
|
||||
|
|
@ -21,19 +20,6 @@ testTokenization('qsharp', [
|
|||
{ startIndex: 29, type: 'delimiter.qsharp' }
|
||||
]
|
||||
},
|
||||
{
|
||||
line: 'open Microsoft.Quantum.Measurement;',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.open.qsharp' },
|
||||
{ startIndex: 4, type: 'white.qsharp' },
|
||||
{ startIndex: 5, type: 'namespace.qsharp' },
|
||||
{ startIndex: 14, type: 'delimiter.qsharp' },
|
||||
{ startIndex: 15, type: 'namespace.qsharp' },
|
||||
{ startIndex: 22, type: 'delimiter.qsharp' },
|
||||
{ startIndex: 23, type: 'namespace.qsharp' },
|
||||
{ startIndex: 34, type: 'delimiter.qsharp' }
|
||||
]
|
||||
},
|
||||
{
|
||||
line: '',
|
||||
tokens: []
|
||||
|
|
@ -67,20 +53,6 @@ testTokenization('qsharp', [
|
|||
{ startIndex: 1, type: 'comment.qsharp' }
|
||||
]
|
||||
},
|
||||
{
|
||||
line: ' // superposition state, such that when we measure,',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'white.qsharp' },
|
||||
{ startIndex: 1, type: 'comment.qsharp' }
|
||||
]
|
||||
},
|
||||
{
|
||||
line: ' // all bitstrings occur with equal probability.',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'white.qsharp' },
|
||||
{ startIndex: 1, type: 'comment.qsharp' }
|
||||
]
|
||||
},
|
||||
{
|
||||
line: ' use register = Qubit[nQubits] {',
|
||||
tokens: [
|
||||
|
|
@ -99,13 +71,6 @@ testTokenization('qsharp', [
|
|||
{ startIndex: 31, type: 'delimiter.curly.qsharp' }
|
||||
]
|
||||
},
|
||||
{
|
||||
line: ' // Set qubits in superposition.',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'white.qsharp' },
|
||||
{ startIndex: 2, type: 'comment.qsharp' }
|
||||
]
|
||||
},
|
||||
{
|
||||
line: ' ApplyToEachA(H, register);',
|
||||
tokens: [
|
||||
|
|
@ -120,17 +85,6 @@ testTokenization('qsharp', [
|
|||
{ startIndex: 27, type: 'delimiter.qsharp' }
|
||||
]
|
||||
},
|
||||
{
|
||||
line: '',
|
||||
tokens: []
|
||||
},
|
||||
{
|
||||
line: ' // Measure all qubits and return.',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'white.qsharp' },
|
||||
{ startIndex: 2, type: 'comment.qsharp' }
|
||||
]
|
||||
},
|
||||
{
|
||||
line: ' return ForEach(MResetZ, register);',
|
||||
tokens: [
|
||||
|
|
@ -157,6 +111,76 @@ testTokenization('qsharp', [
|
|||
{
|
||||
line: '}',
|
||||
tokens: [{ startIndex: 0, type: 'delimiter.curly.qsharp' }]
|
||||
},
|
||||
{
|
||||
line: 'struct Foo { First : Int, Second : Int }',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.qsharp' },
|
||||
{ startIndex: 6, type: 'white.qsharp' },
|
||||
{ startIndex: 7, type: 'identifier.qsharp' },
|
||||
{ startIndex: 10, type: 'white.qsharp' },
|
||||
{ startIndex: 11, type: 'delimiter.curly.qsharp' },
|
||||
{ startIndex: 12, type: 'white.qsharp' },
|
||||
{ startIndex: 13, type: 'identifier.qsharp' },
|
||||
{ startIndex: 18, type: 'white.qsharp' },
|
||||
{ startIndex: 19, type: 'operator.qsharp' },
|
||||
{ startIndex: 20, type: 'white.qsharp' },
|
||||
{ startIndex: 21, type: 'type.qsharp' },
|
||||
{ startIndex: 24, type: 'delimiter.qsharp' },
|
||||
{ startIndex: 25, type: 'white.qsharp' },
|
||||
{ startIndex: 26, type: 'identifier.qsharp' },
|
||||
{ startIndex: 32, type: 'white.qsharp' },
|
||||
{ startIndex: 33, type: 'operator.qsharp' },
|
||||
{ startIndex: 34, type: 'white.qsharp' },
|
||||
{ startIndex: 35, type: 'type.qsharp' },
|
||||
{ startIndex: 38, type: 'white.qsharp' },
|
||||
{ startIndex: 39, type: 'delimiter.curly.qsharp' }
|
||||
]
|
||||
},
|
||||
{
|
||||
line: 'Foo.First',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'identifier.qsharp' },
|
||||
{ startIndex: 3, type: 'operator.qsharp' },
|
||||
{ startIndex: 4, type: 'identifier.qsharp' }
|
||||
]
|
||||
},
|
||||
{
|
||||
line: 'import Microsoft.Quantum.Math, Microsoft.Quantum.Diagnostics.*;',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.import.qsharp' },
|
||||
{ startIndex: 6, type: 'white.qsharp' },
|
||||
{ startIndex: 7, type: 'namespace.qsharp' },
|
||||
{ startIndex: 16, type: 'delimiter.qsharp' },
|
||||
{ startIndex: 17, type: 'namespace.qsharp' },
|
||||
{ startIndex: 24, type: 'delimiter.qsharp' },
|
||||
{ startIndex: 25, type: 'identifier.qsharp' },
|
||||
{ startIndex: 29, type: 'delimiter.qsharp' },
|
||||
{ startIndex: 30, type: 'white.qsharp' },
|
||||
{ startIndex: 31, type: 'namespace.qsharp' },
|
||||
{ startIndex: 40, type: 'delimiter.qsharp' },
|
||||
{ startIndex: 41, type: 'namespace.qsharp' },
|
||||
{ startIndex: 48, type: 'delimiter.qsharp' },
|
||||
{ startIndex: 49, type: 'namespace.qsharp' },
|
||||
{ startIndex: 60, type: 'delimiter.qsharp' },
|
||||
{ startIndex: 61, type: 'wildcard.qsharp' },
|
||||
{ startIndex: 62, type: 'delimiter.qsharp' }
|
||||
]
|
||||
},
|
||||
{
|
||||
line: 'export A, B, C;',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.qsharp' },
|
||||
{ startIndex: 6, type: 'white.qsharp' },
|
||||
{ startIndex: 7, type: 'identifier.qsharp' },
|
||||
{ startIndex: 8, type: 'delimiter.qsharp' },
|
||||
{ startIndex: 9, type: 'white.qsharp' },
|
||||
{ startIndex: 10, type: 'identifier.qsharp' },
|
||||
{ startIndex: 11, type: 'delimiter.qsharp' },
|
||||
{ startIndex: 12, type: 'white.qsharp' },
|
||||
{ startIndex: 13, type: 'identifier.qsharp' },
|
||||
{ startIndex: 14, type: 'delimiter.qsharp' }
|
||||
]
|
||||
}
|
||||
]
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -33,12 +33,15 @@ export const language = <languages.IMonarchLanguage>{
|
|||
keywords: [
|
||||
'namespace',
|
||||
'open',
|
||||
'import',
|
||||
'export',
|
||||
'as',
|
||||
'operation',
|
||||
'function',
|
||||
'body',
|
||||
'adjoint',
|
||||
'newtype',
|
||||
'struct',
|
||||
'controlled',
|
||||
'if',
|
||||
'elif',
|
||||
|
|
@ -141,7 +144,6 @@ export const language = <languages.IMonarchLanguage>{
|
|||
'stackalloc',
|
||||
'static',
|
||||
'string',
|
||||
'struct',
|
||||
'switch',
|
||||
'this',
|
||||
'throw',
|
||||
|
|
@ -202,6 +204,7 @@ export const language = <languages.IMonarchLanguage>{
|
|||
'^=',
|
||||
':',
|
||||
'::',
|
||||
'.',
|
||||
'..',
|
||||
'==',
|
||||
'...',
|
||||
|
|
@ -241,6 +244,8 @@ export const language = <languages.IMonarchLanguage>{
|
|||
|
||||
namespaceFollows: ['namespace', 'open'],
|
||||
|
||||
importsFollows: ['import'],
|
||||
|
||||
symbols: /[=><!~?:&|+\-*\/\^%@._]+/,
|
||||
|
||||
escapes: /\\[\s\S]/,
|
||||
|
|
@ -257,6 +262,10 @@ export const language = <languages.IMonarchLanguage>{
|
|||
token: 'keyword.$0',
|
||||
next: '@namespace'
|
||||
},
|
||||
'@importsFollows': {
|
||||
token: 'keyword.$0',
|
||||
next: '@imports'
|
||||
},
|
||||
'@typeKeywords': 'type',
|
||||
'@keywords': 'keyword',
|
||||
'@constants': 'constant',
|
||||
|
|
@ -282,7 +291,7 @@ export const language = <languages.IMonarchLanguage>{
|
|||
[/[;,.]/, 'delimiter'],
|
||||
|
||||
// strings
|
||||
//[/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-teminated string
|
||||
//[/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-terminated string
|
||||
[/"/, { token: 'string.quote', bracket: '@open', next: '@string' }]
|
||||
],
|
||||
|
||||
|
|
@ -295,7 +304,16 @@ export const language = <languages.IMonarchLanguage>{
|
|||
namespace: [
|
||||
{ include: '@whitespace' },
|
||||
[/[A-Za-z]\w*/, 'namespace'],
|
||||
[/[\.=]/, 'delimiter'],
|
||||
[/[\.]/, 'delimiter'],
|
||||
['', '', '@pop']
|
||||
],
|
||||
|
||||
imports: [
|
||||
{ include: '@whitespace' },
|
||||
[/[A-Za-z]\w*(?=\.)/, 'namespace'],
|
||||
[/[A-Za-z]\w*/, 'identifier'],
|
||||
[/\*/, 'wildcard'],
|
||||
[/[\.,]/, 'delimiter'],
|
||||
['', '', '@pop']
|
||||
],
|
||||
|
||||
|
|
|
|||
24
src/basic-languages/typespec/typespec.contribution.ts
Normal file
24
src/basic-languages/typespec/typespec.contribution.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { registerLanguage } from '../_.contribution';
|
||||
|
||||
declare var AMD: any;
|
||||
declare var require: any;
|
||||
|
||||
registerLanguage({
|
||||
id: 'typespec',
|
||||
extensions: ['.tsp'],
|
||||
aliases: ['TypeSpec'],
|
||||
loader: () => {
|
||||
if (AMD) {
|
||||
return new Promise((resolve, reject) => {
|
||||
require(['vs/basic-languages/typespec/typespec'], resolve, reject);
|
||||
});
|
||||
} else {
|
||||
return import('./typespec');
|
||||
}
|
||||
}
|
||||
});
|
||||
500
src/basic-languages/typespec/typespec.test.ts
Normal file
500
src/basic-languages/typespec/typespec.test.ts
Normal file
|
|
@ -0,0 +1,500 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { testTokenization } from '../test/testRunner';
|
||||
|
||||
// Those test were auto generated from the test in the https://github.com/microsoft/typespec repo
|
||||
// to keep in sync you can follow the instruction in https://github.com/microsoft/typespec/blob/main/packages/monarch/README.md
|
||||
|
||||
testTokenization('typespec', [
|
||||
[
|
||||
{
|
||||
line: 'import "@typespec/http";',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 6,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 7,
|
||||
type: 'string.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 23,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'using TypeSpec.Http',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 5,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 6,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 14,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 15,
|
||||
type: 'identifier.tsp'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'namespace Foo {}',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 9,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 10,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 13,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'namespace Foo {',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 9,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 10,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 13,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
line: ' model Bar {}',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 4,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 9,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 10,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 13,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
line: ' }',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'model Foo {}',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 5,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 6,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 9,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'model Foo is Bar;',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 5,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 6,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 9,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 10,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 12,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 13,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 16,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'model Foo extends Bar;',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 5,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 6,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 9,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 10,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 17,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 18,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 21,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'interface Foo {}',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 9,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 10,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 13,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'union Foo {}',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 5,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 6,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 9,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'scalar foo extends string;',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 6,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 7,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 10,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 11,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 18,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 19,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 25,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'op test(): void;',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 2,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 3,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 7,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 11,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 15,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'enum Direction { up, down }',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 4,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 5,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 14,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 17,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 19,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 21,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 25,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'alias Foo = "a" | "b";',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 5,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 6,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 9,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 12,
|
||||
type: 'string.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 15,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 18,
|
||||
type: 'string.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 21,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
line: 'alias T = """',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'keyword.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 5,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 6,
|
||||
type: 'identifier.tsp'
|
||||
},
|
||||
{
|
||||
startIndex: 7,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
startIndex: 11,
|
||||
type: 'string.tsp'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
line: ' this',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'string.tsp'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
line: ' is',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'string.tsp'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
line: ' multiline',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'string.tsp'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
line: ' """',
|
||||
tokens: [
|
||||
{
|
||||
startIndex: 0,
|
||||
type: 'string.tsp'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]);
|
||||
130
src/basic-languages/typespec/typespec.ts
Normal file
130
src/basic-languages/typespec/typespec.ts
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
import type { languages } from '../../fillers/monaco-editor-core';
|
||||
|
||||
const bounded = (text: string) => `\\b${text}\\b`;
|
||||
const notBefore = (regex: string) => `(?!${regex})`;
|
||||
|
||||
const identifierStart = '[_a-zA-Z]';
|
||||
const identifierContinue = '[_a-zA-Z0-9]';
|
||||
const identifier = bounded(`${identifierStart}${identifierContinue}*`);
|
||||
const directive = bounded(`[_a-zA-Z-0-9]+`);
|
||||
|
||||
const keywords = [
|
||||
'import',
|
||||
'model',
|
||||
'scalar',
|
||||
'namespace',
|
||||
'op',
|
||||
'interface',
|
||||
'union',
|
||||
'using',
|
||||
'is',
|
||||
'extends',
|
||||
'enum',
|
||||
'alias',
|
||||
'return',
|
||||
'void',
|
||||
'if',
|
||||
'else',
|
||||
'projection',
|
||||
'dec',
|
||||
'extern',
|
||||
'fn'
|
||||
];
|
||||
const namedLiterals = ['true', 'false', 'null', 'unknown', 'never'];
|
||||
const nonCommentWs = `[ \\t\\r\\n]`;
|
||||
const numericLiteral = `[0-9]+`;
|
||||
|
||||
export const conf: languages.LanguageConfiguration = {
|
||||
comments: {
|
||||
lineComment: '//',
|
||||
blockComment: ['/*', '*/']
|
||||
},
|
||||
brackets: [
|
||||
['{', '}'],
|
||||
['[', ']'],
|
||||
['(', ')']
|
||||
],
|
||||
autoClosingPairs: [
|
||||
{ open: '{', close: '}' },
|
||||
{ open: '[', close: ']' },
|
||||
{ open: '(', close: ')' },
|
||||
{ open: '"', close: '"' },
|
||||
{ open: '/**', close: ' */', notIn: ['string'] }
|
||||
],
|
||||
surroundingPairs: [
|
||||
{ open: '{', close: '}' },
|
||||
{ open: '[', close: ']' },
|
||||
{ open: '(', close: ')' },
|
||||
{ open: '"', close: '"' }
|
||||
],
|
||||
indentationRules: {
|
||||
decreaseIndentPattern: new RegExp('^((?!.*?/\\*).*\\*/)?\\s*[\\}\\]].*$'),
|
||||
increaseIndentPattern: new RegExp(
|
||||
'^((?!//).)*(\\{([^}"\'`/]*|(\\t|[ ])*//.*)|\\([^)"\'`/]*|\\[[^\\]"\'`/]*)$'
|
||||
),
|
||||
// e.g. * ...| or */| or *-----*/|
|
||||
unIndentedLinePattern: new RegExp(
|
||||
'^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$'
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
export const language: languages.IMonarchLanguage = {
|
||||
defaultToken: '',
|
||||
tokenPostfix: '.tsp',
|
||||
brackets: [
|
||||
{ open: '{', close: '}', token: 'delimiter.curly' },
|
||||
{ open: '[', close: ']', token: 'delimiter.square' },
|
||||
{ open: '(', close: ')', token: 'delimiter.parenthesis' }
|
||||
],
|
||||
symbols: /[=:;<>]+/,
|
||||
keywords,
|
||||
namedLiterals,
|
||||
escapes: `\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|"|\\\${)`,
|
||||
tokenizer: {
|
||||
root: [{ include: '@expression' }, { include: '@whitespace' }],
|
||||
stringVerbatim: [
|
||||
{ regex: `(|"|"")[^"]`, action: { token: 'string' } },
|
||||
{ regex: `"""${notBefore(`"`)}`, action: { token: 'string', next: '@pop' } }
|
||||
],
|
||||
stringLiteral: [
|
||||
{ regex: `\\\${`, action: { token: 'delimiter.bracket', next: '@bracketCounting' } },
|
||||
{ regex: `[^\\\\"$]+`, action: { token: 'string' } },
|
||||
{ regex: '@escapes', action: { token: 'string.escape' } },
|
||||
{ regex: `\\\\.`, action: { token: 'string.escape.invalid' } },
|
||||
{ regex: `"`, action: { token: 'string', next: '@pop' } }
|
||||
],
|
||||
bracketCounting: [
|
||||
{ regex: `{`, action: { token: 'delimiter.bracket', next: '@bracketCounting' } },
|
||||
{ regex: `}`, action: { token: 'delimiter.bracket', next: '@pop' } },
|
||||
{ include: '@expression' }
|
||||
],
|
||||
comment: [
|
||||
{ regex: `[^\\*]+`, action: { token: 'comment' } },
|
||||
{ regex: `\\*\\/`, action: { token: 'comment', next: '@pop' } },
|
||||
{ regex: `[\\/*]`, action: { token: 'comment' } }
|
||||
],
|
||||
whitespace: [
|
||||
{ regex: nonCommentWs },
|
||||
{ regex: `\\/\\*`, action: { token: 'comment', next: '@comment' } },
|
||||
{ regex: `\\/\\/.*$`, action: { token: 'comment' } }
|
||||
],
|
||||
expression: [
|
||||
{ regex: `"""`, action: { token: 'string', next: '@stringVerbatim' } },
|
||||
{ regex: `"${notBefore(`""`)}`, action: { token: 'string', next: '@stringLiteral' } },
|
||||
{ regex: numericLiteral, action: { token: 'number' } },
|
||||
{
|
||||
regex: identifier,
|
||||
action: {
|
||||
cases: {
|
||||
'@keywords': { token: 'keyword' },
|
||||
'@namedLiterals': { token: 'keyword' },
|
||||
'@default': { token: 'identifier' }
|
||||
}
|
||||
}
|
||||
},
|
||||
{ regex: `@${identifier}`, action: { token: 'tag' } },
|
||||
{ regex: `#${directive}`, action: { token: 'directive' } }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as mode from './jsonMode';
|
||||
import { Emitter, IEvent, languages, Uri } from 'monaco-editor-core';
|
||||
import { Emitter, IEvent, languages, Uri } from '../../fillers/monaco-editor-core';
|
||||
|
||||
// ---- JSON service types ----
|
||||
export interface BaseASTNode {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ export const libFileSet: Record<string, boolean> = {}
|
|||
libFileSet['lib.d.ts'] = true;
|
||||
libFileSet['lib.decorators.d.ts'] = true;
|
||||
libFileSet['lib.decorators.legacy.d.ts'] = true;
|
||||
libFileSet['lib.dom.asynciterable.d.ts'] = true;
|
||||
libFileSet['lib.dom.d.ts'] = true;
|
||||
libFileSet['lib.dom.iterable.d.ts'] = true;
|
||||
libFileSet['lib.es2015.collection.d.ts'] = true;
|
||||
|
|
@ -27,7 +28,9 @@ libFileSet['lib.es2015.symbol.wellknown.d.ts'] = true;
|
|||
libFileSet['lib.es2016.array.include.d.ts'] = true;
|
||||
libFileSet['lib.es2016.d.ts'] = true;
|
||||
libFileSet['lib.es2016.full.d.ts'] = true;
|
||||
libFileSet['lib.es2016.intl.d.ts'] = true;
|
||||
libFileSet['lib.es2017.d.ts'] = true;
|
||||
libFileSet['lib.es2017.date.d.ts'] = true;
|
||||
libFileSet['lib.es2017.full.d.ts'] = true;
|
||||
libFileSet['lib.es2017.intl.d.ts'] = true;
|
||||
libFileSet['lib.es2017.object.d.ts'] = true;
|
||||
|
|
@ -74,14 +77,21 @@ libFileSet['lib.es2022.regexp.d.ts'] = true;
|
|||
libFileSet['lib.es2022.sharedmemory.d.ts'] = true;
|
||||
libFileSet['lib.es2022.string.d.ts'] = true;
|
||||
libFileSet['lib.es2023.array.d.ts'] = true;
|
||||
libFileSet['lib.es2023.collection.d.ts'] = true;
|
||||
libFileSet['lib.es2023.d.ts'] = true;
|
||||
libFileSet['lib.es2023.full.d.ts'] = true;
|
||||
libFileSet['lib.es5.d.ts'] = true;
|
||||
libFileSet['lib.es6.d.ts'] = true;
|
||||
libFileSet['lib.esnext.collection.d.ts'] = true;
|
||||
libFileSet['lib.esnext.d.ts'] = true;
|
||||
libFileSet['lib.esnext.decorators.d.ts'] = true;
|
||||
libFileSet['lib.esnext.disposable.d.ts'] = true;
|
||||
libFileSet['lib.esnext.full.d.ts'] = true;
|
||||
libFileSet['lib.esnext.intl.d.ts'] = true;
|
||||
libFileSet['lib.esnext.object.d.ts'] = true;
|
||||
libFileSet['lib.esnext.promise.d.ts'] = true;
|
||||
libFileSet['lib.scripthost.d.ts'] = true;
|
||||
libFileSet['lib.webworker.asynciterable.d.ts'] = true;
|
||||
libFileSet['lib.webworker.d.ts'] = true;
|
||||
libFileSet['lib.webworker.importscripts.d.ts'] = true;
|
||||
libFileSet['lib.webworker.iterable.d.ts'] = true;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
5921
src/language/typescript/lib/typescriptServices.d.ts
vendored
5921
src/language/typescript/lib/typescriptServices.d.ts
vendored
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
|
@ -2,4 +2,4 @@
|
|||
// **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript`
|
||||
//
|
||||
|
||||
export const typescriptVersion = "5.0.2";
|
||||
export const typescriptVersion = "5.4.5";
|
||||
|
|
|
|||
|
|
@ -216,9 +216,10 @@ export interface DiagnosticRelatedInformation {
|
|||
messageText: string | DiagnosticMessageChain;
|
||||
}
|
||||
|
||||
interface EmitOutput {
|
||||
export interface EmitOutput {
|
||||
outputFiles: OutputFile[];
|
||||
emitSkipped: boolean;
|
||||
diagnostics?: Diagnostic[];
|
||||
}
|
||||
interface OutputFile {
|
||||
name: string;
|
||||
|
|
@ -521,7 +522,11 @@ export interface TypeScriptWorker {
|
|||
* Get transpiled output for the given file.
|
||||
* @returns `typescript.EmitOutput`
|
||||
*/
|
||||
getEmitOutput(fileName: string): Promise<EmitOutput>;
|
||||
getEmitOutput(
|
||||
fileName: string,
|
||||
emitOnlyDtsFiles?: boolean,
|
||||
forceDtsEmit?: boolean
|
||||
): Promise<EmitOutput>;
|
||||
|
||||
/**
|
||||
* Get possible code fixes at the given position in the file.
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { libFileMap } from './lib/lib';
|
|||
import {
|
||||
Diagnostic,
|
||||
DiagnosticRelatedInformation,
|
||||
EmitOutput,
|
||||
IExtraLibs,
|
||||
TypeScriptWorker as ITypeScriptWorker
|
||||
} from './monaco.contribution';
|
||||
|
|
@ -401,11 +402,26 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, ITypeScriptWork
|
|||
return this._languageService.getRenameInfo(fileName, position, options);
|
||||
}
|
||||
|
||||
async getEmitOutput(fileName: string): Promise<ts.EmitOutput> {
|
||||
async getEmitOutput(
|
||||
fileName: string,
|
||||
emitOnlyDtsFiles?: boolean,
|
||||
forceDtsEmit?: boolean
|
||||
): Promise<EmitOutput> {
|
||||
if (fileNameIsLib(fileName)) {
|
||||
return { outputFiles: [], emitSkipped: true };
|
||||
}
|
||||
return this._languageService.getEmitOutput(fileName);
|
||||
// The diagnostics property is internal, returning it without clearing breaks message serialization.
|
||||
const emitOutput = this._languageService.getEmitOutput(
|
||||
fileName,
|
||||
emitOnlyDtsFiles,
|
||||
forceDtsEmit
|
||||
) as ts.EmitOutput & {
|
||||
diagnostics?: ts.Diagnostic[];
|
||||
};
|
||||
const diagnostics = emitOutput.diagnostics
|
||||
? TypeScriptWorker.clearFiles(emitOutput.diagnostics)
|
||||
: undefined;
|
||||
return { ...emitOutput, diagnostics };
|
||||
}
|
||||
|
||||
async getCodeFixesAtPosition(
|
||||
|
|
|
|||
39
src/nls-fix.js
Normal file
39
src/nls-fix.js
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/* This fix ensures that old nls-plugin configurations are still respected by the new localization solution. */
|
||||
/* We should try to avoid this file and find a different solution. */
|
||||
/* Warning: This file still has to work when replacing "\n" with " "! */
|
||||
|
||||
/**
|
||||
* @type {typeof define}
|
||||
*/
|
||||
const globalDefine = globalThis.define;
|
||||
globalDefine('vs/nls.messages-loader', [], function (...args) {
|
||||
return {
|
||||
load: (name, req, load, config) => {
|
||||
const requestedLanguage = config['vs/nls']?.availableLanguages?.['*'];
|
||||
if (!requestedLanguage || requestedLanguage === 'en') {
|
||||
load({});
|
||||
} else {
|
||||
req([`vs/nls.messages.${requestedLanguage}`], () => {
|
||||
load({});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
globalDefine(
|
||||
'vs/nls.messages',
|
||||
['require', 'exports', 'vs/nls.messages-loader!'],
|
||||
function (require, exports) {
|
||||
Object.assign(exports, {
|
||||
getNLSMessages: () => globalThis._VSCODE_NLS_MESSAGES,
|
||||
getNLSLanguage: () => globalThis._VSCODE_NLS_LANGUAGE
|
||||
});
|
||||
}
|
||||
);
|
||||
define = function (...args) {
|
||||
if (args.length > 0 && args[0] === 'vs/nls.messages') {
|
||||
return;
|
||||
}
|
||||
return globalDefine(...args);
|
||||
};
|
||||
define.amd = true;
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
<script src="../../../out/monaco-editor/dev/vs/loader.js"></script>
|
||||
<script>
|
||||
require.config({
|
||||
baseUrl: new URL('..', document.baseURI).toString(),
|
||||
paths: {
|
||||
vs: '../../../out/monaco-editor/dev/vs'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="out/index.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="editor-container" style="position: absolute; width: 500px; height: 400px"></div>
|
||||
|
|
|
|||
|
|
@ -186,16 +186,22 @@ suite(`Smoke Test '${testInfo.packager}' on '${testInfo.browser}'`, () => {
|
|||
await page.waitForSelector(`text=addEventListener`);
|
||||
|
||||
// find the TypeScript worker
|
||||
const tsWorker = page.workers().find((worker) => {
|
||||
const url = worker.url();
|
||||
return /ts\.worker(\.[a-f0-9]+)?\.js$/.test(url) || /workerMain.js#typescript$/.test(url);
|
||||
});
|
||||
if (!tsWorker) {
|
||||
assert.fail('Could not find TypeScript worker');
|
||||
|
||||
function findAsync(arr, fn) {
|
||||
return Promise.all(arr.map(fn)).then((results) => {
|
||||
return arr.find((_, i) => results[i]);
|
||||
});
|
||||
}
|
||||
|
||||
// check that the TypeScript worker exposes `ts` as a global
|
||||
assert.strictEqual(await tsWorker.evaluate(`typeof ts`), 'object');
|
||||
const tsWorker = await findAsync(
|
||||
page.workers(),
|
||||
async (page) => await page.evaluate(`typeof ts !== 'undefined'`)
|
||||
);
|
||||
|
||||
if (!tsWorker) {
|
||||
assert.fail('Could not find TypeScript worker');
|
||||
}
|
||||
|
||||
// check that the TypeScript worker exposes the full `ts` as a global
|
||||
assert.strictEqual(await tsWorker.evaluate(`typeof ts.optionDeclarations`), 'object');
|
||||
|
|
|
|||
|
|
@ -35,7 +35,9 @@ global.window = {
|
|||
matches: false,
|
||||
addEventListener: function () {}
|
||||
};
|
||||
}
|
||||
},
|
||||
setInterval: function () {},
|
||||
setTimeout: function () {}
|
||||
};
|
||||
|
||||
requirejs(
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@ define('vs/nls', [], {
|
|||
localize: function () {
|
||||
return 'NO_LOCALIZATION_FOR_YOU';
|
||||
},
|
||||
localize2: function (key, message) {
|
||||
return { value: 'NO_LOCALIZATION_FOR_YOU', original: message };
|
||||
},
|
||||
load: function (name, req, load) {
|
||||
load({});
|
||||
}
|
||||
|
|
|
|||
16
webpack-plugin/package-lock.json
generated
16
webpack-plugin/package-lock.json
generated
|
|
@ -17,7 +17,7 @@
|
|||
"glob": "^7.2.0",
|
||||
"monaco-editor": "^0.32.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"webpack": "^5.68.0",
|
||||
"webpack-cli": "^4.9.2"
|
||||
},
|
||||
|
|
@ -1628,16 +1628,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz",
|
||||
"integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.20"
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/uri-js": {
|
||||
|
|
@ -2995,9 +2995,9 @@
|
|||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz",
|
||||
"integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true
|
||||
},
|
||||
"uri-js": {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
"glob": "^7.2.0",
|
||||
"monaco-editor": "^0.32.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"typescript": "^5.0.2",
|
||||
"typescript": "^5.4.5",
|
||||
"webpack": "^5.68.0",
|
||||
"webpack-cli": "^4.9.2"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@
|
|||
"react": "^17.0.2",
|
||||
"react-bootstrap": "^2.4.0",
|
||||
"react-dom": "^17.0.2",
|
||||
"typedoc": "^0.23.26"
|
||||
"typedoc": "^0.25.12",
|
||||
"@vscode/web-editors": "./vscode-web-editors.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/classnames": "^2.3.1",
|
||||
|
|
@ -50,8 +51,8 @@
|
|||
"style-loader": "^1.1.3",
|
||||
"ts-loader": "^9.3.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.0.2",
|
||||
"webpack": "^5.76.0",
|
||||
"typescript": "^5.4.5",
|
||||
"webpack": "^5.90.1",
|
||||
"webpack-bundle-analyzer": "^4.5.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"webpack-dev-server": "^4.9.3"
|
||||
|
|
|
|||
|
|
@ -62,6 +62,10 @@ async function _loadMonaco(setup: IMonacoSetup): Promise<typeof monaco> {
|
|||
return new Promise((res) => {
|
||||
// First load editor.main. If it inlines the plugins, we don't want to try to load them from the server.
|
||||
req(["vs/editor/editor.main"], () => {
|
||||
if ((setup as any).onlyCore) {
|
||||
res(monaco);
|
||||
return;
|
||||
}
|
||||
req(
|
||||
[
|
||||
"vs/basic-languages/monaco.contribution",
|
||||
|
|
|
|||
19
website/src/tsconfig.json
Normal file
19
website/src/tsconfig.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"strict": true,
|
||||
"outDir": "dist",
|
||||
"skipLibCheck": true,
|
||||
"rootDir": ".",
|
||||
"resolveJsonModule": true,
|
||||
"newLine": "LF",
|
||||
"sourceMap": true,
|
||||
"jsx": "react",
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["**/*", "../node_modules/monaco-editor/monaco.d.ts"]
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import React = require("react");
|
||||
import * as React from "react";
|
||||
import { home, playground, docs, monarch } from "../pages/routes";
|
||||
import { Container, Navbar, Nav, NavDropdown } from "./bootstrap";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React = require("react");
|
||||
import * as React from "react";
|
||||
import { PageNav } from "./Nav";
|
||||
|
||||
export function Page(props: { children: React.ReactNode }) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { observer } from "mobx-react";
|
||||
import React = require("react");
|
||||
import * as React from "react";
|
||||
import { IReference } from "../utils/ref";
|
||||
import { Form } from "./bootstrap";
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@ export class ControlledMonacoEditor extends React.Component<{
|
|||
|
||||
private lastSubscription: monaco.IDisposable | undefined;
|
||||
|
||||
componentDidMount(): void {
|
||||
this.componentDidUpdate({ value: "" });
|
||||
}
|
||||
|
||||
componentDidUpdate(lastProps: this["props"]) {
|
||||
const newOnDidValueChange = this.props.onDidValueChange;
|
||||
if (newOnDidValueChange !== lastProps.onDidValueChange) {
|
||||
|
|
|
|||
71
website/src/website/data/home-samples/sample.typespec.txt
Normal file
71
website/src/website/data/home-samples/sample.typespec.txt
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
import "@typespec/rest";
|
||||
import "@typespec/openapi";
|
||||
import "./decorators.js";
|
||||
|
||||
using TypeSpec.Http;
|
||||
|
||||
@service({
|
||||
title: "Pet Store Service",
|
||||
})
|
||||
/** This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. */
|
||||
namespace PetStore;
|
||||
|
||||
// Model types
|
||||
model Pet {
|
||||
name: string;
|
||||
tag?: string;
|
||||
|
||||
@minValue(0)
|
||||
@maxValue(20)
|
||||
age: int32;
|
||||
}
|
||||
|
||||
model Toy {
|
||||
id: int64;
|
||||
petId: int64;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/** Error */
|
||||
@error
|
||||
model Error {
|
||||
code: int32;
|
||||
message: string;
|
||||
}
|
||||
|
||||
/** Not modified */
|
||||
model NotModified<Body> {
|
||||
@statusCode _: 304;
|
||||
@body body: Body;
|
||||
}
|
||||
|
||||
@friendlyName("{name}ListResults", Item)
|
||||
model ResponsePage<Item> {
|
||||
items: Item[];
|
||||
nextLink?: string;
|
||||
}
|
||||
|
||||
model PetId {
|
||||
@path petId: int32;
|
||||
}
|
||||
|
||||
/** Manage your pets. */
|
||||
@route("/pets")
|
||||
namespace Pets {
|
||||
/** Delete a pet. */
|
||||
@delete
|
||||
op delete(...PetId): OkResponse | Error;
|
||||
|
||||
@fancyDoc("List pets.")
|
||||
op list(@query nextLink?: string): ResponsePage<Pet> | Error;
|
||||
|
||||
/** Returns a pet. Supports eTags. */
|
||||
op read(...PetId): Pet | (NotModifiedResponse & Pet) | Error;
|
||||
|
||||
@post op create(@body pet: Pet): Pet | Error;
|
||||
}
|
||||
|
||||
@route("/pets/{petId}/toys")
|
||||
namespace ListPetToysResponse {
|
||||
op list(@path petId: string, @query nameFilter: string): ResponsePage<Toy> | Error;
|
||||
}
|
||||
|
|
@ -9,7 +9,6 @@
|
|||
paths: { vs: "node_modules/monaco-editor/min/vs" },
|
||||
};
|
||||
require("script-loader!../../node_modules/monaco-editor/min/vs/loader");
|
||||
require("script-loader!../../node_modules/monaco-editor/min/vs/editor/editor.main.nls.js");
|
||||
require("script-loader!../../node_modules/monaco-editor/min/vs/editor/editor.main.js");
|
||||
import { loadMonaco } from "../monaco-loader";
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as packageJson from "monaco-editor/package.json";
|
||||
import packageJson from "monaco-editor/package.json";
|
||||
|
||||
export const monacoEditorVersion = packageJson.version;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Home } from "./home/Home";
|
||||
import { PlaygroundPage } from "./playground/PlaygroundPage";
|
||||
import { docs, home, monarch, playground } from "./routes";
|
||||
import React = require("react");
|
||||
import * as React from "react";
|
||||
import { DocsPage } from "./DocsPage";
|
||||
import { MonarchPage } from "./MonarchPage";
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import {
|
|||
IHistoryModel,
|
||||
ILocation,
|
||||
} from "../utils/ObservableHistory";
|
||||
import React = require("react");
|
||||
import * as React from "react";
|
||||
|
||||
export class DocsPage extends React.Component implements IHistoryModel {
|
||||
private _lastIFrame: HTMLIFrameElement | null = null;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React = require("react");
|
||||
import * as React from "react";
|
||||
import { Page } from "../components/Page";
|
||||
|
||||
export class MonarchPage extends React.Component<{}, {}> {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import {
|
|||
ControlledMonacoEditor,
|
||||
} from "../../components/monaco/MonacoEditor";
|
||||
import { ObservablePromise } from "../../utils/ObservablePromise";
|
||||
import React = require("react");
|
||||
import * as React from "react";
|
||||
import { ref } from "../../utils/ref";
|
||||
import { monacoEditorVersion } from "../../monacoEditorVersion";
|
||||
|
||||
|
|
|
|||
|
|
@ -38,13 +38,18 @@ export class LocationModel implements IHistoryModel {
|
|||
*/
|
||||
@observable historyId: number = 0;
|
||||
|
||||
constructor(private readonly model: PlaygroundModel) {
|
||||
this.dispose.track(
|
||||
new HistoryController((initialLocation) => {
|
||||
this.updateLocation(initialLocation);
|
||||
return this;
|
||||
})
|
||||
);
|
||||
constructor(
|
||||
private readonly model: PlaygroundModel,
|
||||
createHistoryController = true
|
||||
) {
|
||||
if (createHistoryController) {
|
||||
this.dispose.track(
|
||||
new HistoryController((initialLocation) => {
|
||||
this.updateLocation(initialLocation);
|
||||
return this;
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
get location(): ILocation {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import {
|
|||
} from "./SettingsModel";
|
||||
import { BisectModel } from "./BisectModel";
|
||||
import { LocationModel } from "./LocationModel";
|
||||
import { createJsonWebEditorClient, vObj, vString } from "@vscode/web-editors";
|
||||
|
||||
export class PlaygroundModel {
|
||||
public readonly dispose = Disposable.fn();
|
||||
|
|
@ -47,7 +48,25 @@ export class PlaygroundModel {
|
|||
@observable
|
||||
public reloadKey = 0;
|
||||
|
||||
public readonly historyModel = new LocationModel(this);
|
||||
private readonly webEditorClient = createJsonWebEditorClient(
|
||||
vObj({
|
||||
js: vString(),
|
||||
html: vString(),
|
||||
css: vString(),
|
||||
}),
|
||||
(data) => {
|
||||
runInAction(() => {
|
||||
this.html = data.html;
|
||||
this.js = data.js;
|
||||
this.css = data.css;
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
public readonly historyModel = new LocationModel(
|
||||
this,
|
||||
this.webEditorClient === undefined
|
||||
);
|
||||
|
||||
public reload(): void {
|
||||
this.reloadKey++;
|
||||
|
|
@ -163,6 +182,17 @@ export class PlaygroundModel {
|
|||
constructor() {
|
||||
let lastState: IPreviewState | undefined = undefined;
|
||||
|
||||
this.webEditorClient?.onDidConnect.then(() => {
|
||||
autorun(() => {
|
||||
const state = this.playgroundProject;
|
||||
this.webEditorClient!.updateContent({
|
||||
js: state.js,
|
||||
html: state.html,
|
||||
css: state.css,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.dispose.track({
|
||||
dispose: reaction(
|
||||
() => ({ state: this.state }),
|
||||
|
|
|
|||
|
|
@ -42,7 +42,12 @@ export class SettingsModel {
|
|||
}
|
||||
|
||||
constructor() {
|
||||
const settingsStr = localStorage.getItem(this.settingsKey);
|
||||
const settingsStr = "";
|
||||
try {
|
||||
localStorage.getItem(this.settingsKey);
|
||||
} catch (e) {
|
||||
console.error("Failed to load settings from localStorage", e);
|
||||
}
|
||||
if (settingsStr) {
|
||||
this._settings = JSON.parse(settingsStr);
|
||||
} else {
|
||||
|
|
@ -54,7 +59,11 @@ export class SettingsModel {
|
|||
setSettings(settings: Settings): void {
|
||||
const settingsJson = JSON.stringify(toJS(settings));
|
||||
this._settings = JSON.parse(settingsJson);
|
||||
localStorage.setItem(this.settingsKey, settingsJson);
|
||||
try {
|
||||
localStorage.setItem(this.settingsKey, settingsJson);
|
||||
} catch (e) {
|
||||
console.error("Failed to save settings to localStorage", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import { normalizeLineEnding } from "./utils";
|
||||
import { IPlaygroundProject } from "../../../shared";
|
||||
|
||||
export function findLastIndex<T>(
|
||||
|
|
|
|||
|
|
@ -5338,7 +5338,6 @@ return {
|
|||
};
|
||||
</script>
|
||||
<script src="./node_modules/monaco-editor/dev/vs/loader.js"></script>
|
||||
<script src="./node_modules/monaco-editor/dev/vs/editor/editor.main.nls.js"></script>
|
||||
<script src="./node_modules/monaco-editor/dev/vs/editor/editor.main.js"></script>
|
||||
|
||||
<script data-inline="yes-please" src="./monarch/monarch.js"></script>
|
||||
|
|
|
|||
|
|
@ -2,18 +2,15 @@
|
|||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node16",
|
||||
"moduleResolution": "Node",
|
||||
"strict": true,
|
||||
"outDir": "dist",
|
||||
"skipLibCheck": true,
|
||||
"rootDir": "./src",
|
||||
"resolveJsonModule": true,
|
||||
"newLine": "LF",
|
||||
"sourceMap": true,
|
||||
"jsx": "react",
|
||||
"experimentalDecorators": true,
|
||||
// to enable mobx decorators
|
||||
"useDefineForClassFields": false
|
||||
"useDefineForClassFields": false,
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["src/**/*", "./node_modules/monaco-editor/monaco.d.ts"]
|
||||
"exclude": ["src/**/*", "./node_modules/monaco-editor/monaco.d.ts"]
|
||||
}
|
||||
|
|
|
|||
BIN
website/vscode-web-editors.tgz
Normal file
BIN
website/vscode-web-editors.tgz
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue