| 2029 | //--------------------------------------------------------- |
| 2030 | |
| 2031 | export class IDE { |
| 2032 | protected _fileCache:{[fileId:string]: string} = {}; |
| 2033 | |
| 2034 | /** The id of the active document. */ |
| 2035 | documentId?:string; |
| 2036 | /** Whether the active document has been loaded. */ |
| 2037 | loaded = false; |
| 2038 | /** Whether the IDE is currently loading a new document. */ |
| 2039 | loading = false; |
| 2040 | |
| 2041 | /** When attempting to overwrite an existing document with a new one, the ID of the document to overwrite. */ |
| 2042 | overwriteId:string; |
| 2043 | |
| 2044 | /** The current editor generation. Used for imposing a relative ordering on parses. */ |
| 2045 | generation = 0; |
| 2046 | /** Whether the currently open document is a modified version of an example. */ |
| 2047 | modified = false; |
| 2048 | /** Whether or not files are stored and operated on purely locally */ |
| 2049 | local = false; |
| 2050 | |
| 2051 | /** Whether the inspector is currently active. */ |
| 2052 | inspecting = false; |
| 2053 | |
| 2054 | /** Whether the next click should be an inspector click automatically (as opposed to requiring Cmd or Ctrl modifiers. */ |
| 2055 | inspectingClick = false; |
| 2056 | |
| 2057 | renderer:Renderer = new Renderer(); |
| 2058 | |
| 2059 | notices:{message: string|ElemGen, type: string, time: number}[] = []; |
| 2060 | |
| 2061 | languageService:LanguageService = new LanguageService(); |
| 2062 | navigator:Navigator = new Navigator(this); |
| 2063 | editor:Editor = new Editor(this); |
| 2064 | comments:Comments = new Comments(this); |
| 2065 | |
| 2066 | constructor( ) { |
| 2067 | document.body.appendChild(this.renderer.content); |
| 2068 | this.renderer.content.classList.add("ide-root"); |
| 2069 | |
| 2070 | this.enableInspector(); |
| 2071 | this.monitorInputState(); |
| 2072 | } |
| 2073 | |
| 2074 | elem() { |
| 2075 | return {c: `editor-root`, children: [ |
| 2076 | this.navigator.render(), |
| 2077 | {c: "main-pane", children: [ |
| 2078 | this.noticesElem(), |
| 2079 | this.editor.render(), |
| 2080 | this.overwriteId ? this.overwritePrompt() : undefined, |
| 2081 | ]}, |
| 2082 | this.comments.render() |
| 2083 | ]}; |
| 2084 | } |
| 2085 | |
| 2086 | noticesElem() { |
| 2087 | let items = []; |
| 2088 | for(let notice of this.notices) { |
nothing calls this directly
no test coverage detected