Skip to content

Commit

Permalink
0.0.1 Release
Browse files Browse the repository at this point in the history
- List handling features
  • Loading branch information
CFiggers committed Sep 2, 2023
1 parent ee36a2e commit 3e3d70e
Show file tree
Hide file tree
Showing 15 changed files with 1,072 additions and 146 deletions.
8 changes: 3 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Change Log

All notable changes to the "typst-companion" extension will be documented in this file.
All notable changes to Typst Companion will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## 0.0.1

## [Unreleased]

- Initial release
- Initial release of Typst Companion.
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2023 Caleb Figgers

With attributed inclusions Copyright (c) 2017 张宇

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
70 changes: 13 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,27 @@
# typst-companion README
# Typst Companion

This is the README for your extension "typst-companion". After writing up a brief description, we recommend including the following sections.
A VS Code extension that adds Markdown-like editing niceties **on top of and in addition to** to Nathan Varner's [Typst LSP](https://github.com/nvarner/typst-lsp).

## Features

Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.

For example if there is an image subfolder under your extension project workspace:

\!\[feature X\]\(images/feature-x.png\)

> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
- Intuitive handling of Ordered and Unordered lists in `.typ` files.
- `Enter` while in a list context (either ordered or unordered) continues the existing list at the current level of indentation (with correct numbering, if ordered).
- `Tab` and `Shift+Tab` while in a list context (either ordered or unordered) indents and out-dents bullets intuitively (and re-numbers ordered lists if appropriate).
- Reordering lines inside an ordered list automatically updates the list numbers accordingly.

## Requirements

If you have any requirements or dependencies, add a section describing those and how to install and configure them.

## Extension Settings

Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.

For example:

This extension contributes the following settings:

* `myExtension.enable`: Enable/disable this extension.
* `myExtension.thing`: Set to `blah` to do something.

## Known Issues

Calling out known issues can help limit users opening duplicate issues against your extension.
I *strongly* encourage installing Nathan Varner's [Typst LSP](https://github.com/nvarner/typst-lsp) in addition to this extension for syntax highlighting, error reporting, code completion, and all of Typst LSP's other features.
This extension just adds some small additional features that I missed when using Typst LSP.

## Release Notes

Users appreciate release notes as you update your extension.

### 1.0.0

Initial release of ...

### 1.0.1

Fixed issue #.

### 1.1.0

Added features X, Y, and Z.

---

## Following extension guidelines

Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.

* [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines)

## Working with Markdown

You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
### 0.0.1

* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux).
* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux).
* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets.
Initial release of Typst Companion.

## For more information
## Prior Art

* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
The core logic of this extension is adapted, with attribution and gratitude, from [Markdown All-in-One](https://github.com/yzhang-gh/vscode-markdown/), under the following license:

**Enjoy!**
MIT License, Copyright (c) 2017 张宇
Binary file added icons/typst-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/typst.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"comments": {
"lineComment": "//",
"blockComment": ["/*", "*/"]
},
"brackets": [
["[", "]"],
["{", "}"],
["(", ")"]
],
"autoClosingPairs": [
{
"open": "[",
"close": "]"
},
{
"open": "{",
"close": "}"
},
{
"open": "(",
"close": ")"
},
{
"open": "\"",
"close": "\"",
"notIn": ["string"]
},
{
"open": "$",
"close": "$",
"notIn": ["string"]
}
],
"autoCloseBefore": "$ \n\t",
"surroundingPairs": [
["[", "]"],
["{", "}"],
["(", ")"],
["\"", "\""],
["*", "*"],
["_", "_"],
["`", "`"],
["$", "$"]
]
}
137 changes: 132 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,150 @@
{
"name": "typst-companion",
"displayName": "Typst Companion",
"description": "Adds editing niceities on top of Typst LSP.",
"description": "Adds Markdown-like editing niceties on top of Typst LSP.",
"version": "0.0.1",
"author": "Caleb Figgers",
"publisher": "Caleb Figgers",
"icon": "icons/typst.png",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/CFiggers/typst-companion"
},
"engines": {
"vscode": "^1.81.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onCommand:typst-companion.helloWorld"
"onLanguage:typst"
],
"main": "./dist/extension.js",
"contributes": {
"commands": [
"configuration": [
{
"type": "object",
"title": "Typst Markdown",
"properties": {
"typst-companion.extension.orderedList.autoRenumber": {
"type": "boolean",
"default": true,
"description": "Auto fix ordered list markers."
},
"typst-companion.extension.orderedList.marker": {
"type": "string",
"default": "ordered",
"description": "Ordered list marker.",
"enum": [
"ordered",
"plus"
],
"markdownEnumDescriptions": [
"Use increasing numbers as ordered list marker.",
"Always use `+` as ordered list marker."
]
},
"typst-companion.extension.list.indentationSize": {
"type": "string",
"enum": [
"adaptive",
"inherit"
],
"markdownEnumDescriptions": [
"Adaptive indentation size according to the context, trying to left align the sublist with its parent's content.",
"Use the configured tab size of the current document (see the status bar)."
],
"default": "inherit",
"markdownDescription": "Whether to use different indentation sizes on different list contexts or stick to VS Code's tab size.",
"scope": "resource"
}
}
}
],
"languages": [
{
"id": "typst",
"configuration": "./language-configuration.json",
"extensions": [
".typ"
],
"aliases": [
"Typst"
],
"icon": {
"light": "./icons/typst-small.png",
"dark": "./icons/typst-small.png"
}
}
],
"keybindings": [
{
"command": "typst-companion.extension.onEnterKey",
"key": "enter",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst && !suggestWidgetVisible && !editorHasMultipleSelections && vim.mode != 'Normal' && vim.mode != 'Visual' && vim.mode != 'VisualBlock' && vim.mode != 'VisualLine' && vim.mode != 'SearchInProgressMode' && vim.mode != 'CommandlineInProgress' && vim.mode != 'Replace' && vim.mode != 'EasyMotionMode' && vim.mode != 'EasyMotionInputMode' && vim.mode != 'SurroundInputMode'"
},
{
"command": "typst-companion.extension.onCtrlEnterKey",
"key": "ctrl+enter",
"mac": "cmd+enter",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst && !suggestWidgetVisible && !editorHasMultipleSelections"
},
{
"command": "typst-companion.extension.onShiftEnterKey",
"key": "shift+enter",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst && !suggestWidgetVisible && !editorHasMultipleSelections"
},
{
"command": "typst-companion.extension.onTabKey",
"key": "tab",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst && !suggestWidgetVisible && !inlineSuggestionVisible && !editorHasMultipleSelections && !editorTabMovesFocus && !inSnippetMode && !hasSnippetCompletions && !hasOtherSuggestions && typst-companion.extension.editor.cursor.inList"
},
{
"command": "typst-companion.extension.onShiftTabKey",
"key": "shift+tab",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst && !suggestWidgetVisible && !editorHasMultipleSelections && !editorTabMovesFocus && !inSnippetMode && !hasSnippetCompletions && !hasOtherSuggestions && typst-companion.extension.editor.cursor.inList"
},
{
"command": "typst-companion.extension.onBackspaceKey",
"key": "backspace",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst && !suggestWidgetVisible && !editorHasMultipleSelections && vim.mode != 'Normal' && vim.mode != 'Visual' && vim.mode != 'VisualBlock' && vim.mode != 'VisualLine' && vim.mode != 'SearchInProgressMode' && vim.mode != 'CommandlineInProgress' && vim.mode != 'Replace' && vim.mode != 'EasyMotionMode' && vim.mode != 'EasyMotionInputMode' && vim.mode != 'SurroundInputMode'"
},
{
"command": "typst-companion.extension.onMoveLineUp",
"key": "alt+up",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst && !suggestWidgetVisible"
},
{
"command": "typst-companion.extension.onMoveLineDown",
"key": "alt+down",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst && !suggestWidgetVisible"
},
{
"command": "typst-companion.extension.onCopyLineUp",
"win": "shift+alt+up",
"mac": "shift+alt+up",
"linux": "ctrl+shift+alt+up",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst && !suggestWidgetVisible"
},
{
"command": "typst-companion.extension.onCopyLineDown",
"win": "shift+alt+down",
"mac": "shift+alt+down",
"linux": "ctrl+shift+alt+down",
"when": "editorTextFocus && !editorReadonly && editorLangId == typst && !suggestWidgetVisible"
},
{
"command": "typst-companion.extension.onIndentLines",
"key": "ctrl+]",
"mac": "cmd+]",
"when": "editorTextFocus && editorLangId == typst && !suggestWidgetVisible"
},
{
"command": "typst-companion.helloWorld",
"title": "Hello World"
"command": "typst-companion.extension.onOutdentLines",
"key": "ctrl+[",
"mac": "cmd+[",
"when": "editorTextFocus && editorLangId == typst && !suggestWidgetVisible"
}
]
},
Expand Down
39 changes: 39 additions & 0 deletions src/IDisposable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// From https://github.com/yzhang-gh/vscode-markdown/ , under the following license:
//
// MIT License

// Copyright (c) 2017 张宇

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//

"use strict";

/**
* @see <https://code.visualstudio.com/api/references/vscode-api#Disposable>
* @see <https://github.com/dotnet/runtime/blob/master/src/libraries/System.Private.CoreLib/src/System/IDisposable.cs>
* @see <https://referencesource.microsoft.com/#mscorlib/system/idisposable.cs>
*/
export default interface IDisposable {

/**
* Performs application-defined tasks associated with freeing, releasing, or resetting resources.
*/
dispose(): any;
}
Loading

0 comments on commit 3e3d70e

Please sign in to comment.