MCPcopy Index your code
hub / github.com/reactide/reactide / _openFile

Method _openFile

renderer/components/TextEditor.js:104–123  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

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) {

Callers 2

componentDidMountMethod · 0.95
componentDidUpdateMethod · 0.95

Calls 2

_initializeFileMethod · 0.95
_lintCodeMethod · 0.95

Tested by

no test coverage detected