-
Notifications
You must be signed in to change notification settings - Fork 234
Tips and Known Issues
Zhengbo Li edited this page Jul 22, 2015
·
1 revision
- Sublime Text 3 does not inform plug-ins of all buffer changes. We are still learning how to detect changes in all cases. If the view contents is out-of-sync with the server, you can re-sync by running the Undo command once. The usual way to notice out-of-sync content is to see a surprising error message.
- Snippets may contain text fields, which are placeholders within the snippet. The presence of text fields changes the key binding context and may temporarily turn off some of the TypeScript key bindings. You can exit all snippet text fields by hitting the escape key. You can tab from one text field to the next until you have exhausted the text fields (possibly filling them in along the way).
- The server does not yet have file watch support for tsconfig.json projects. This means that if your tsconfig.json file does not have a "files" property, and you add a new file to a directory configured by that tsconfig.json file, you will need to restart Sublime to get that file noticed. The same applies to changes in the options properties of the tsconfig.json file.
- Sublime Text 2 will be slow for files of about 2K lines or more. This happens because Sublime Text 2 does not reliably inform plug-ins of buffer changes and therefore the plug-in has to frequently send the entire view contents to the server.
- By default, the plug-in retains the Sublime native behavior for auto indent (such as when typing the Enter key). To have the TypeScript server supply auto indent, set the 'typescript_auto_indent' setting to true in your Preferences.sublime-settings file. The plug-in does by default request TypeScript formatting upon typing ';' or '}'. You can turn off TypeScript formatting on these characters by setting 'typescript_auto_format' to false. The size of the indentation is controlled by the 'indent_size' setting. If this setting is not present, then indentation size will be set to 'tab_size'.
- You can get TypeScript formatting for a line by typing 'ctrl+;'. You can get TypeScript formatting for a document by typing 'ctrl+t, ctrl+f'. If a selection is present that same key sequence will format only the selection. You can get TypeScript formatting for a block by typing 'ctrl+}' from within that block. After formatting, the cursor will be placed outside the block, so that you can continue to type 'ctrl+}' to format the next outer block.
- The plug-in looks for the installed node executable using the PATH environment variable of the Sublime process and also in the directory '/usr/local/bin'. If your node installation placed the node executable elsewhere, then add the 'node_path' setting to your Preferences.sublime-settings file. The value of the 'node_path' setting should be the pathname of the node executable as in '/usr/myinstalldir/node'. You can look for the message 'spawning node module ...' in the Sublime console view (ctrl + ` or View -> Show Console). The line of text after this will indicate whether the plug-in was able to find the node executable.
- When you open a file f.ts, the server will first check if f.ts is configured by a tsconfig.json project. If so, f.ts becomes part of that project. If not, then the server checks to see if f.ts is referenced by any open projects. If not, a new inferred project is created for f.ts and the files in the inferred project are those transitively referenced by comments in f.ts. Coming in a future release will be a way to list the files in each configured or inferred project. Also coming will be a way to see the current set of compiler diagnostics for each project.
- The plug-in tries to avoid remapping existing Sublime key bindings or context menu entries. For example, goto definition in the context menu refers to the Sublime goto definition, which is based on syntactically finding declarations and which has its own rules for choosing a set of files to search.