* Increase timeout for parsing the syntax tree when it's done for the first time
* Return the already parsed blocks in the blockState facet from Editor.getBlocks() instead of parsing the syntax tree again.
Make the block extension's getBlocks() method private.
* Add language support for TypeScript
* Add formatter for TypeScript
* Add language autodetection for TypeScript
* Add TypeScript to list of featured languages
* Add language support for JSX and TSX
* Add JSX and TSX to list of featured languages
* Remove guesslang token from JSX and TSX
* Fix syntax error
---------
Co-authored-by: Jonatan Heyman <jonatan@heyman.info>
* Contain language selection dialog in an element that can be scrolled, and automatically scroll it if needed when navigating the list with arrow keys
* Add support for more languages:
Clojure, Erlang, Golang, Lezer, Ruby, Shell, YAML
* Move prettier auto format settings for languages into Language() class
* Remove invalid import
* Fix bug that could cause auto formatting to fail for the last block.
Add tests for language auto detection and formatting.
* Fix broken tests
* Fix language auto detection on Safari Webkit which was broken
* Remove unnecessary wait time
* Set up Playwright and add first test
* Add npm run commands for running tests
Run tests in github actions
* Fix tests on non Mac environments
* Add method to HeynoteEditor class to set the buffer content
* Add more tests
* Set Github action job name
* Move windows.darkMode -> window.heynote.themeMode
* Only add UpdateStatusItem if window.heynote.autoUpdate is set
* Update Vite
* Implement web version of Heynote.
Add a child vite project in ./webapp/ that is Heynote running within a browser. Imports almost all code from ../src/ and only adds a thin bridge that corresponds to the API between the Electron main process and the app code.
* Remove commented out tag
* Specify publicDir in vite config, instead of using a symlink
* Add webapp_dev npm command to package.json
* Add npm run command: webapp:build
* Add resolve alias '@' that points to project root.
Move assets file from public to assets in order to let Vite/Rollup handle bundling.
E.g. if you pasted a piece of javascript, selected the whole block and deleted the text (which will change back the default language to Plaintext (auto)) and then paste the same javascript code again.
* Add bufferPath to config, support bufferPath symlink
* defaultPath before checking realpath
* Move code for retrieving buffer path into its own file
* Do the realpathSync() call for the whole final file path, to allow the buffer file to be a symlink
---------
Co-authored-by: Jonatan Heyman <jonatan@heyman.info>
Prettier currently has a bug that causes it's formatWithCursor() to be extremely slow in some cases. In Heynote, whenever you pasted a large JSON chunk and auto formatted it, with the cursor at the beginning or the start of the block, this would trigger that bug. This commit introduces a work around by using format() if the cursor is at the beginning or the end of the block.
Update to latest version of Prettier.