mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-06-20 06:51:12 +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({
|
||||
baseUrl: '/out/',
|
||||
name: 'hl/yaml/' + moduleId,
|
||||
name: 'vs/languages/yaml/' + moduleId,
|
||||
out: moduleId + '.js',
|
||||
exclude: exclude,
|
||||
paths: {
|
||||
'hl/yaml': __dirname + '/out'
|
||||
'vs/languages/yaml': __dirname + '/out'
|
||||
},
|
||||
packages: [{
|
||||
name: 'yaml-ast-parser',
|
||||
|
|
@ -100,7 +100,7 @@ gulp.task('release', ['clean-release', 'compile'], function () {
|
|||
|
||||
return merge(
|
||||
merge(
|
||||
bundleOne('monaco.contribution', ['hl/yaml/yamlMode']),
|
||||
bundleOne('monaco.contribution', ['vs/languages/yaml/yamlMode']),
|
||||
bundleOne('yamlMode'),
|
||||
bundleOne('yamlWorker')
|
||||
)
|
||||
|
|
|
|||
|
|
@ -62,13 +62,15 @@ monaco.languages.yaml = createAPI();
|
|||
// --- Registration to monaco editor ---
|
||||
|
||||
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({
|
||||
// id: 'yaml',
|
||||
// extensions: ['.yml'],
|
||||
// });
|
||||
monaco.languages.register({
|
||||
id: 'yaml',
|
||||
extensions: ['.yaml', '.yml'],
|
||||
aliases: ['YAML', 'yaml', 'YML', 'yml'],
|
||||
mimetypes: ['application/x-yaml']
|
||||
});
|
||||
monaco.languages.onLanguage('yaml', () => {
|
||||
withMode(mode => mode.setupMode(yamlDefaults));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ export class WorkerManager {
|
|||
this._worker = monaco.editor.createWebWorker<YAMLWorker>({
|
||||
|
||||
// module that exports the create() method and returns a `YAMLWorker` instance
|
||||
moduleId: 'hl/yaml/yamlWorker',
|
||||
moduleId: 'vs/languages/yaml/yamlWorker',
|
||||
|
||||
label: this._defaults.languageId,
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
var require = {
|
||||
paths: {
|
||||
'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'
|
||||
}
|
||||
};
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
<script>
|
||||
require([
|
||||
'vs/basic-languages/src/monaco.contribution',
|
||||
'vs/language/json/monaco.contribution'
|
||||
'vs/language/yaml/monaco.contribution'
|
||||
], function() {
|
||||
var editor = monaco.editor.create(document.getElementById('container'), {
|
||||
value: [
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
' }',
|
||||
'}',
|
||||
].join('\n'),
|
||||
language: 'json'
|
||||
language: 'yaml'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue