Replies: 1 comment
-
Try to add them as libs. However it should work without adding libs. May be you need to pass correct uri in createModel(). monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
noSemanticValidation: true,
noSyntaxValidation: false
});
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
target: monaco.languages.typescript.ScriptTarget.ES6,
allowNonTsExtensions: true
});
// extra libraries
var libSource =
`
interface Application {
/**
* Test JSDOC
*/
onLaunch(): void;
}
interface ApplicationFactory {
extends(): Application;
hui: String;
}
interface ControllerFactory {
extends(): Controller;
}
interface Controller {
/**
* asdf afads fasd fadsf asdf adsfads f
*/
onLoad(): void;
}
type Registry = {
"ac/1": ApplicationFactory;
"ac/2": ControllerFactory;
};
const define = (depNames: ["ac/1", "ac/2"], factory: (a: ApplicationFactory, b: ControllerFactory) => ) => void;
`
var libUri = 'ts:filename/facts.d.ts';
monaco.languages.typescript.javascriptDefaults.addExtraLib(libSource, libUri);
monaco.editor.createModel(libSource, 'typescript', monaco.Uri.parse(libUri));
var jsCode = `define(['ac/1', 'ac/2'], (a, b) => {
//fill me
a.
a.extends().onLaunch
})
//hover over me
define()`
monaco.editor.create(document.getElementById('container'), {
value: jsCode,
language: 'javascript'
});
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Context
Description
I am trying to figure out how to do multi-file autocompletion, intellisense, goto-def.
I have done the following:
However, I do not have auto complextion/goto-def working across files.
Are there (up-to-date) instructions anywhere on how to make this work?
Beta Was this translation helpful? Give feedback.
All reactions