mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-07-07 20:10:41 +00:00
Rename path to more common location
This commit is contained in:
parent
16750098e4
commit
e658a06c82
4 changed files with 14 additions and 12 deletions
|
|
@ -52,11 +52,11 @@ gulp.task('release', ['clean-release', 'compile'], function () {
|
||||||
|
|
||||||
return rjs({
|
return rjs({
|
||||||
baseUrl: '/out/',
|
baseUrl: '/out/',
|
||||||
name: 'hl/yaml/' + moduleId,
|
name: 'vs/languages/yaml/' + moduleId,
|
||||||
out: moduleId + '.js',
|
out: moduleId + '.js',
|
||||||
exclude: exclude,
|
exclude: exclude,
|
||||||
paths: {
|
paths: {
|
||||||
'hl/yaml': __dirname + '/out'
|
'vs/languages/yaml': __dirname + '/out'
|
||||||
},
|
},
|
||||||
packages: [{
|
packages: [{
|
||||||
name: 'yaml-ast-parser',
|
name: 'yaml-ast-parser',
|
||||||
|
|
@ -100,7 +100,7 @@ gulp.task('release', ['clean-release', 'compile'], function () {
|
||||||
|
|
||||||
return merge(
|
return merge(
|
||||||
merge(
|
merge(
|
||||||
bundleOne('monaco.contribution', ['hl/yaml/yamlMode']),
|
bundleOne('monaco.contribution', ['vs/languages/yaml/yamlMode']),
|
||||||
bundleOne('yamlMode'),
|
bundleOne('yamlMode'),
|
||||||
bundleOne('yamlWorker')
|
bundleOne('yamlWorker')
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -62,13 +62,15 @@ monaco.languages.yaml = createAPI();
|
||||||
// --- Registration to monaco editor ---
|
// --- Registration to monaco editor ---
|
||||||
|
|
||||||
function withMode(callback: (module: typeof mode) => void): void {
|
function withMode(callback: (module: typeof mode) => void): void {
|
||||||
require<typeof mode>(['hl/yaml/yamlMode'], callback);
|
require<typeof mode>(['vs/languages/yaml/yamlMode'], callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
// monaco.languages.register({
|
monaco.languages.register({
|
||||||
// id: 'yaml',
|
id: 'yaml',
|
||||||
// extensions: ['.yml'],
|
extensions: ['.yaml', '.yml'],
|
||||||
// });
|
aliases: ['YAML', 'yaml', 'YML', 'yml'],
|
||||||
|
mimetypes: ['application/x-yaml']
|
||||||
|
});
|
||||||
monaco.languages.onLanguage('yaml', () => {
|
monaco.languages.onLanguage('yaml', () => {
|
||||||
withMode(mode => mode.setupMode(yamlDefaults));
|
withMode(mode => mode.setupMode(yamlDefaults));
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ export class WorkerManager {
|
||||||
this._worker = monaco.editor.createWebWorker<YAMLWorker>({
|
this._worker = monaco.editor.createWebWorker<YAMLWorker>({
|
||||||
|
|
||||||
// module that exports the create() method and returns a `YAMLWorker` instance
|
// module that exports the create() method and returns a `YAMLWorker` instance
|
||||||
moduleId: 'hl/yaml/yamlWorker',
|
moduleId: 'vs/languages/yaml/yamlWorker',
|
||||||
|
|
||||||
label: this._defaults.languageId,
|
label: this._defaults.languageId,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
var require = {
|
var require = {
|
||||||
paths: {
|
paths: {
|
||||||
'vs/basic-languages': '../node_modules/monaco-languages/release',
|
'vs/basic-languages': '../node_modules/monaco-languages/release',
|
||||||
'vs/language/json': '../release/dev',
|
'vs/language/yaml': '../release/dev',
|
||||||
'vs': '../node_modules/monaco-editor-core/dev/vs'
|
'vs': '../node_modules/monaco-editor-core/dev/vs'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
<script>
|
<script>
|
||||||
require([
|
require([
|
||||||
'vs/basic-languages/src/monaco.contribution',
|
'vs/basic-languages/src/monaco.contribution',
|
||||||
'vs/language/json/monaco.contribution'
|
'vs/language/yaml/monaco.contribution'
|
||||||
], function() {
|
], function() {
|
||||||
var editor = monaco.editor.create(document.getElementById('container'), {
|
var editor = monaco.editor.create(document.getElementById('container'), {
|
||||||
value: [
|
value: [
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
' }',
|
' }',
|
||||||
'}',
|
'}',
|
||||||
].join('\n'),
|
].join('\n'),
|
||||||
language: 'json'
|
language: 'yaml'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue