{"id":13470133,"url":"https://github.com/ananthakumaran/tide","last_synced_at":"2025-05-14T11:11:17.071Z","repository":{"id":31805143,"uuid":"35371728","full_name":"ananthakumaran/tide","owner":"ananthakumaran","description":"Tide - TypeScript Interactive Development Environment for Emacs","archived":false,"fork":false,"pushed_at":"2024-10-19T21:01:27.000Z","size":27088,"stargazers_count":1462,"open_issues_count":37,"forks_count":111,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-05-14T11:00:18.392Z","etag":null,"topics":["emacs","typescript"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ananthakumaran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-10T13:18:18.000Z","updated_at":"2025-05-09T09:34:52.000Z","dependencies_parsed_at":"2025-01-16T11:03:02.850Z","dependency_job_id":"358431e4-bb9a-4433-8032-9e932a0b121c","html_url":"https://github.com/ananthakumaran/tide","commit_stats":{"total_commits":451,"total_committers":58,"mean_commits":7.775862068965517,"dds":"0.39689578713968954","last_synced_commit":"6a35fe355f1442da34b976bf2decf008d6e4f991"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananthakumaran%2Ftide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananthakumaran%2Ftide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananthakumaran%2Ftide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananthakumaran%2Ftide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ananthakumaran","download_url":"https://codeload.github.com/ananthakumaran/tide/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254129497,"owners_count":22019628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emacs","typescript"],"created_at":"2024-07-31T16:00:23.677Z","updated_at":"2025-05-14T11:11:12.058Z","avatar_url":"https://github.com/ananthakumaran.png","language":"Emacs Lisp","readme":"# Tide\n\n![Build Status](https://github.com/ananthakumaran/tide/workflows/CI/badge.svg)\n\n*TypeScript Interactive Development Environment for Emacs*\n\n[screencast](http://i.imgur.com/jEwgPsd.gif)\n\n### Installation\n\n* Tide requires Emacs 25 or later. We recommend Emacs 27 or later with native json support.\n* Install [node.js](https://nodejs.org/) v0.14.0 or greater.\n* Make sure\n  [tsconfig.json](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html)\n  or\n  [jsconfig.json](https://code.visualstudio.com/docs/languages/jsconfig)\n  is present in the root folder of the project.\n* Tide is available in [melpa](http://melpa.org/#/tide). You can\n  install tide via package-install \u003ckbd\u003eM-x package-install [ret] tide\u003c/kbd\u003e\n\n### Configuration\n\n#### TypeScript\n```elisp\n(defun setup-tide-mode ()\n  (interactive)\n  (tide-setup)\n  (flycheck-mode +1)\n  (setq flycheck-check-syntax-automatically '(save mode-enabled))\n  (eldoc-mode +1)\n  (tide-hl-identifier-mode +1)\n  ;; company is an optional dependency. You have to\n  ;; install it separately via package-install\n  ;; `M-x package-install [ret] company`\n  (company-mode +1))\n\n;; aligns annotation to the right hand side\n(setq company-tooltip-align-annotations t)\n\n;; formats the buffer before saving\n(add-hook 'before-save-hook 'tide-format-before-save)\n\n;; if you use typescript-mode\n(add-hook 'typescript-mode-hook #'setup-tide-mode)\n;; if you use treesitter based typescript-ts-mode (emacs 29+)\n(add-hook 'typescript-ts-mode-hook #'setup-tide-mode)\n```\n\n#### Format options\n\nFormat options can be specified in multiple ways.\n\n* via elisp\n\n```elisp\n(setq tide-format-options '(:insertSpaceAfterFunctionKeywordForAnonymousFunctions t :placeOpenBraceOnNewLineForFunctions nil))\n```\n\n* via tsfmt.json (should be present in the root folder along with tsconfig.json)\n```json\n{\n  \"indentSize\": 4,\n  \"tabSize\": 4,\n  \"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces\": false,\n  \"placeOpenBraceOnNewLineForFunctions\": false,\n  \"placeOpenBraceOnNewLineForControlBlocks\": false\n}\n```\nCheck [here][format_options] for the full list of supported format options.\n\n\n#### TSX without treesitter\n```elisp\n(require 'web-mode)\n(add-to-list 'auto-mode-alist '(\"\\\\.tsx\\\\'\" . web-mode))\n(add-hook 'web-mode-hook\n          (lambda ()\n            (when (string-equal \"tsx\" (file-name-extension buffer-file-name))\n              (setup-tide-mode))))\n;; enable typescript-tslint checker\n(flycheck-add-mode 'typescript-tslint 'web-mode)\n```\n#### TSX with treesitter\nTreesitter comes with tsx major mode built in.\n```elisp\n(add-hook 'tsx-ts-mode-hook #'setup-tide-mode)\n```\n\nTide also provides support for editing js \u0026 jsx files. Tide checkers\n`javascript-tide` and `jsx-tide` are not enabled by default for js \u0026\njsx files. It can be enabled by setting [`flycheck-checker`](http://www.flycheck.org/en/latest/user/syntax-checkers.html#variable-flycheck-checker)\n\n#### JavaScript\n\nCreate `jsconfig.json` in the root folder of your project.\n`jsconfig.json` is `tsconfig.json` with `allowJs` attribute set to\ntrue.\n\n```json\n{\n  \"compilerOptions\": {\n    \"target\": \"es2017\",\n    \"allowSyntheticDefaultImports\": true,\n    \"noEmit\": true,\n    \"checkJs\": true,\n    \"jsx\": \"react\",\n    \"lib\": [ \"dom\", \"es2017\" ]\n  }\n}\n```\n\n\n```elisp\n(add-hook 'js2-mode-hook #'setup-tide-mode)\n;; configure javascript-tide checker to run after your default javascript checker\n(flycheck-add-next-checker 'javascript-eslint 'javascript-tide 'append)\n```\n\n#### JSX\n```elisp\n(require 'web-mode)\n(add-to-list 'auto-mode-alist '(\"\\\\.jsx\\\\'\" . web-mode))\n(add-hook 'web-mode-hook\n          (lambda ()\n            (when (string-equal \"jsx\" (file-name-extension buffer-file-name))\n              (setup-tide-mode))))\n;; configure jsx-tide checker to run after your default jsx checker\n(flycheck-add-mode 'javascript-eslint 'web-mode)\n(flycheck-add-next-checker 'javascript-eslint 'jsx-tide 'append)\n```\n\n#### Use Package\n```elisp\n;; if you use typescript-mode\n(use-package tide\n  :ensure t\n  :after (typescript-mode company flycheck)\n  :hook ((typescript-mode . tide-setup)\n         (typescript-mode . tide-hl-identifier-mode)\n         (before-save . tide-format-before-save)))\n         \n;; if you use treesitter based typescript-ts-mode (emacs 29+)\n(use-package tide\n  :ensure t\n  :after (company flycheck)\n  :hook ((typescript-ts-mode . tide-setup)\n         (tsx-ts-mode . tide-setup)\n         (typescript-ts-mode . tide-hl-identifier-mode)\n         (before-save . tide-format-before-save)))\n```\n\n### Commands\n\nKeyboard shortcuts                  | Description\n------------------------------------|----------\n\u003ckbd\u003eM-.\u003c/kbd\u003e                      | Jump to the definition of the symbol at point. With a prefix arg, Jump to the type definition.\n\u003ckbd\u003eM-,\u003c/kbd\u003e                      | Return to your pre-jump position.\n\n\u003ckbd\u003eM-x tide-restart-server\u003c/kbd\u003e Restart tsserver. This would come\nin handy after you edit tsconfig.json or checkout a different branch.\n\n\u003ckbd\u003eM-x tide-documentation-at-point\u003c/kbd\u003e Load the documentation for the\nsymbol at point to buffer `*tide-documentation*`.\n\n\u003ckbd\u003eM-x tide-references\u003c/kbd\u003e List all references to the symbol\nat point in a buffer. References can be navigated using \u003ckbd\u003en\u003c/kbd\u003e\nand \u003ckbd\u003ep\u003c/kbd\u003e. Press \u003ckbd\u003eenter\u003c/kbd\u003e to open the file.\n\n\u003ckbd\u003eM-x tide-project-errors\u003c/kbd\u003e List all errors in the\nproject. Errors can be navigated using \u003ckbd\u003en\u003c/kbd\u003e and\n\u003ckbd\u003ep\u003c/kbd\u003e. Press \u003ckbd\u003eenter\u003c/kbd\u003e to open the file.\n\n\u003ckbd\u003eM-x tide-error-at-point\u003c/kbd\u003e Load the details of the error at point\nto buffer `*tide-error*`.\n\n\u003ckbd\u003eM-x tide-rename-symbol\u003c/kbd\u003e Rename all occurrences of the symbol\nat point.\n\n\u003ckbd\u003eM-x tide-rename-file\u003c/kbd\u003e Rename current file and all it's\nreferences in other files.\n\n\u003ckbd\u003eM-x tide-format\u003c/kbd\u003e Format the current region or buffer.\n\n\u003ckbd\u003eM-x tide-fix\u003c/kbd\u003e Apply code fix for the error at point. When\ninvoked with a prefix arg, apply code fix for all the errors in the file\nthat are similar to the error at point.\n\n\u003ckbd\u003eM-x tide-add-tslint-disable-next-line\u003c/kbd\u003e If the point is on\none or more tslint errors, add a `tslint:disable-next-line` flag on\nthe previous line to silence the errors. Or, if a flag already exists\non the previous line, modify the flag to silence the errors.\n\n\u003ckbd\u003eM-x tide-refactor\u003c/kbd\u003e Refactor code at point or current region.\n\n\u003ckbd\u003eM-x tide-jsdoc-template\u003c/kbd\u003e Insert JSDoc comment template at\npoint.\n\n\u003ckbd\u003eM-x tide-verify-setup\u003c/kbd\u003e Show the version of tsserver.\n\n\u003ckbd\u003eM-x tide-organize-imports\u003c/kbd\u003e Organize imports in the file.\n\n\u003ckbd\u003eM-x tide-list-servers\u003c/kbd\u003e List the `tsserver` processes launched by\ntide.\n\n### Features\n\n* Xref\n* ElDoc\n* Auto complete\n* Flycheck\n* Jump to definition, Jump to type definition\n* Find occurrences\n* Rename symbol\n* Imenu\n* Compile On Save\n* Highlight Identifiers\n* Code Fixes\n* Code Refactor\n* Organize Imports\n\n### Debugging\n\n![architecture](https://github.com/ananthakumaran/tide/raw/master/doc/architecture.mmd.png)\n\nTide uses\n[tsserver](https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29) as the\nbackend for most of the features. It writes out a comprehensive log\nfile which can be captured by setting\n`tide-tsserver-process-environment` variable.\n\n```lisp\n(setq tide-tsserver-process-environment '(\"TSS_LOG=-level verbose -file /tmp/tss.log\"))\n```\n\n\n[format_options]: https://github.com/Microsoft/TypeScript/blob/v3.3.1/src/server/protocol.ts#L2858-L2890\n\n### FAQ?\n\n**How do I configure tide to use a specific version of TypeScript compiler?**\n\nFor TypeScript 2.0 and above, you can customize the\n`tide-tsserver-executable` variable. For example\n```lisp\n(setq tide-tsserver-executable \"node_modules/typescript/bin/tsserver\")\n```\n\nSadly, this won't work for TypeScript \u003c 2.0. You can clone the repo\nlocally and checkout the old version though.\n\n**How do I copy the type information shown in the minibuffer?**\n\nTide has the command `tide-documentation-at-point` to load the\ndocumentation for the symbol at point to buffer `*tide-documentation*`\nfrom where it can be copied. By default, tide will not open this buffer\nif only type information is available. This behavior can be\noverridden by setting `(setq tide-always-show-documentation t)`\n\n### Custom Variables\n\n##### tide-sync-request-timeout `2`\n\nThe number of seconds to wait for a sync response.\n\n##### tide-tsserver-flags `nil`\n\nList of additional flags to provide when starting tsserver.\n\n##### tide-tsserver-process-environment `'nil`\n\nList of extra environment variables to use when starting tsserver.\n\n##### tide-tsserver-executable `nil`\n\nName of tsserver executable to run instead of the bundled tsserver.\n\nThis may either be an absolute path or a relative path. Relative\npaths are resolved against the project root directory.\n\nNote that this option only works with TypeScript version 2.0 and\nabove.\n\n##### tide-tscompiler-executable `nil`\n\nName of tsc executable.\n\nThis may either be an absolute path or a relative path. Relative\npaths are resolved against the project root directory.\n\n##### tide-node-executable `\"node\"`\n\nName or path of the node executable binary file.\n\n##### tide-node-flags `nil`\n\nList of flags to provide to node when starting tsserver.\n\nUseful for large TypeScript codebases which need to set\nmax-old-space-size to a higher value.\n\n##### tide-post-code-edit-hook `nil`\n\nHook run after code edits are applied in a buffer.\n\n##### tide-sort-completions-by-kind `nil`\n\nWhether completions should be sorted by kind.\n\n##### tide-format-options `'nil`\n\nFormat options plist.\n\n##### tide-user-preferences `'(:includeCompletionsForModuleExports t :includeCompletionsWithInsertText t :allowTextChangesInNewFiles t :generateReturnInDocTemplate t)`\n\nUser preference plist used on the configure request.\n\nCheck https://github.com/Microsoft/TypeScript/blob/17eaf50b/src/server/protocol.ts#L2684\nfor the full list of available options.\n\n##### tide-disable-suggestions `nil`\n\nDisable suggestions.\n\nIf set to non-nil, suggestions will not be shown in flycheck\nerrors and tide-project-errors buffer.\n\n##### tide-completion-setup-company-backend `t`\n\nAdd `company-tide` to `company-backends`.\n\n##### tide-completion-ignore-case `nil`\n\nCASE will be ignored in completion if set to non-nil.\n\n##### tide-completion-show-source `nil`\n\nCompletion dropdown will contain completion source if set to non-nil.\n\n##### tide-completion-fuzzy `nil`\n\nAllow fuzzy completion.\n\nBy default only candidates with exact prefix match are shown. If\nset to non-nil, candidates with match anywhere inside the name\nare shown.\n\n##### tide-completion-detailed `nil`\n\nCompletion dropdown will contain detailed method information if set to non-nil.\n\n##### tide-completion-enable-autoimport-suggestions `t`\n\nWhether to include external module exports in completions.\n\n##### tide-enable-xref `t`\n\nWhether to enable xref integration.\n\n##### tide-navto-item-filter `#'tide-navto-item-filter-default`\n\nThe filter for items returned by tide-nav. Defaults to class, interface, type, enum\n\n##### tide-jump-to-definition-reuse-window `t`\n\nReuse existing window when jumping to definition.\n\n##### tide-imenu-flatten `nil`\n\nImenu index will be flattened if set to non-nil.\n\n##### tide-allow-popup-select `'(code-fix refactor)`\n\nThe list of commands where popup selection is allowed.\n\n##### tide-always-show-documentation `nil`\n\nShow the documentation window even if only type information is available.\n\n##### tide-server-max-response-length `102400`\n\nMaximum allowed response length from tsserver. Any response greater than this would be ignored.\n\n##### tide-tsserver-locator-function `#'tide-tsserver-locater-npmlocal-projectile-npmglobal`\n\nFunction used by tide to locate tsserver.\n\n##### tide-project-cleanup-delay `60`\n\nThe number of idle seconds to wait before cleaning up unused tsservers.\nUse `nil` to disable automatic cleanups.  See also `tide-do-cleanups`.\n\n##### tide-tsserver-start-method `'immediate`\n\nThe method by which tide starts tsserver. `immediate` causes tide to start a tsserver instance\nas soon as `tide-mode` is turned on. `manual` means that tide will start a tsserver only when the\nuser manually starts one.\n\n##### tide-default-mode `\"TS\"`\n\nThe default mode to open buffers not backed by files (e.g. Org\nsource blocks) in.\n\n##### tide-recenter-after-jump `t`\n\nRecenter buffer after jumping to definition\n\n##### tide-jump-to-fallback `#'tide-jump-to-fallback-not-given`\n\nThe fallback jump function to use when implementations aren't available.\n\n##### tide-filter-out-warning-completions `nil`\n\nCompletions whose `:kind` property is \"warning\" will be filtered out if set to non-nil.\nThis option is useful for Javascript code completion, because tsserver often returns a lot of irrelevant\ncompletions whose `:kind` property is \"warning\" for Javascript code. You can fix this behavior by setting\nthis variable to non-nil value for Javascript buffers using `setq-local` macro.\n\n##### tide-native-json-parsing `(and\n (\u003e= emacs-major-version 27)\n (functionp 'json-serialize)\n (functionp 'json-parse-buffer)\n (functionp 'json-parse-string))`\n\nUse native JSON parsing (only emacs \u003e= 27).\n\n##### tide-save-buffer-after-code-edit `t`\n\nSave the buffer after applying code edits.\n\n##### tide-hl-identifier-idle-time `0.5`\n\nHow long to wait after user input before highlighting the current identifier.\n\n","funding_links":[],"categories":["Getting Started with (Awesome) TypeScript","Emacs Lisp","TypeScript IDE"],"sub_categories":["IDE","Offline"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fananthakumaran%2Ftide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fananthakumaran%2Ftide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fananthakumaran%2Ftide/lists"}