(path)
| 102 | |
| 103 | // Setup or restore monaco model for the opening file path |
| 104 | _openFile(path) { |
| 105 | let model = this._initializeFile(path); |
| 106 | |
| 107 | // Restore the editor state for the file |
| 108 | const editorState = this.editorStates.get(path); |
| 109 | |
| 110 | if (editorState) { |
| 111 | this.editor.restoreViewState(editorState); |
| 112 | } |
| 113 | |
| 114 | // Bring browser focus to the editor text |
| 115 | this.editor.focus(); |
| 116 | |
| 117 | // Subscribe to change in value so we can notify the parent |
| 118 | this._subscription = model.onDidChangeContent(() => { |
| 119 | const value = model.getValue(); |
| 120 | this.props.onValueChange(value); |
| 121 | this._lintCode(value); |
| 122 | }); |
| 123 | }; |
| 124 | |
| 125 | // Return language type as a string |
| 126 | _getLanguage(path) { |
no test coverage detected