Skip to content

Commit

Permalink
[1.0.0] refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrnperl committed Mar 8, 2023
1 parent 196f895 commit 9fc68b4
Show file tree
Hide file tree
Showing 42 changed files with 6,237 additions and 10,596 deletions.
146 changes: 17 additions & 129 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,77 +1,24 @@
{
"env": {
"browser": true,
"es2021": true
"es2021": true,
"node": true
},
"extends": "eslint:recommended",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"overrides": [
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"globals": {
"CryptoJS": "writable",
"provider": "writable",
"audioVariables": "writable",
"audioState": "writable",
"ui": "writable",
"config": "writable"
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"complexity": [
"warn",
20
],
"dot-notation": "warn",
"dot-location": [
"warn",
"property"
],
"eqeqeq": [
"warn",
"always"
],
"no-empty-function": "warn",
"no-extend-native": "warn",
"no-extra-label": "warn",
"no-fallthrough": [
"off",
{
"commentPattern": "/falls?\\s?through/i"
}
],
"no-multi-spaces": [
"error",
{
"ignoreEOLComments": true,
"exceptions": {
"VariableDeclarator": true,
"ImportDeclaration": true
}
}
],
"no-lone-blocks": "warn",
"no-loop-func": "warn",
"no-new-wrappers": "error",
"guard-for-in": "error",
"no-return-await": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-throw-literal": "warn",
"no-useless-concat": "error",
"no-unused-expressions": ["error", { "allowShortCircuit": true,"allowTernary": true}],
"no-warning-comments": ["off", { "terms": ["todo", "fixme"], "location": "start" }],
"require-unicode-regexp": "warn",
"no-shadow": ["error", { "builtinGlobals": false ,"allow": ["done","reject", "temp","tmp","error","err"] }],
"no-undefined": "off",
"no-undef": "off",
"no-useless-call": "error",
"no-div-regex": "warn",
"no-else-return": "warn",


"indent": [
"error",
"tab"
Expand All @@ -81,71 +28,12 @@
"unix"
],
"quotes": [
"warn",
"error",
"single"
],
"semi": [
"warn",
"error",
"always"
],
"array-bracket-spacing": ["warn", "never"],
"block-spacing": ["warn", "never"],
"brace-style": ["warn", "stroustrup",{ "allowSingleLine": false }],
"comma-dangle": ["warn", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "only-multiline",
"exports": "always-multiline",
"functions": "only-multiline"
}],
"comma-spacing": ["warn", { "before": false, "after": true }],
"comma-style": ["warn", "last"],
"computed-property-spacing": ["warn", "never"],
"func-call-spacing": ["warn", "never"],
// "lines-around-comment": ["warn", { "beforeBlockComment": true }],
"lines-around-comment": "off",
"max-statements-per-line": ["warn", { "max": 1 }],
"no-lonely-if": "warn",
"no-multi-assign": "warn",
"no-multiple-empty-lines": ["warn", { "max": 3}],
"no-negated-condition": "warn",
"no-trailing-spaces": ["warn", { "ignoreComments": true }],
"no-whitespace-before-property": "warn",
"curly": "warn",
"object-curly-spacing": ["warn", "never"],
"operator-linebreak": ["warn", "before"],
"padded-blocks": ["warn", { "blocks": "never","classes": "always","switches": "never" }],
"padding-line-between-statements": [
"warn",
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*"},
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]},
{ "blankLine": "always", "prev": "directive", "next": "*" },
{ "blankLine": "any", "prev": "directive", "next": "directive" }
],
"semi-spacing": ["warn", {"before": false, "after": true}],
"space-before-blocks": ["warn", "never"],
"space-before-function-paren": ["warn", "never"],
"space-in-parens": ["warn", "never"],
"space-infix-ops": ["warn", {"int32Hint": true}],
"space-unary-ops": [
"warn", {
"words": true,
"nonwords": false
}],
"spaced-comment": ["warn", "always", {
"line": {
"markers": ["/"],
"exceptions": ["-", "+","*","=","#"]
},
"block": {
"markers": ["!"],
"exceptions": ["-", "+","*","=","#"],
"balanced": true
}
}],
"switch-colon-spacing": "warn",

"no-var": "error",
"no-unused-vars": "off"
]
}
}
}
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# pnpm options
enable-pre-post-scripts = true
node-linker=hoisted
shamefully-hoist = true
4 changes: 2 additions & 2 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.vscode-test-web/**
src/**
node_modules/**
!node_modules/@vscode/codicons
!node_modules/@vscode/webview-ui-toolkit
node_modules/@vscode/codicons
node_modules/@vscode/webview-ui-toolkit
.gitignore
vsc-extension-quickstart.md
webpack.config.js
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,26 @@ Update presentation
![before](images/before.gif)
- after
![after](images/after.gif)

### [1.0.0] - 2023-03

#### Add
- Now the outline is closer in appearance to vscode's built-in outline

- Overlap Scrollbar

- Search ~issue #28

#### Remove
- configuration: `outline-map.maxDepth`
use `outline-map.defaultMaxDepth` instead

- configuration: `outline-map.enableAutomaticIndentReduction`
the new outline comes with less indent, so this configuration is deprecated.

- the 'stupid' rotation of the icon of the outline node

- configuration: `outline-map.expandOutlineMethod`

#### Other
- Replaced configuration option `outline-map.follow: "cursor-always-open"` with `outline-map.follow: "manual"
55 changes: 26 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

EN | [中文](README_ZH_CN.md)

A visual, interactive outline map that combines the clarity of the outline with the intuitive overview of the minimap. Alternative Minimap.
![overview](screenshots/overview.png)

A visual, interactive outline map that combines the clarity of the outline with the intuitive overview of the minimap. Enhanced version of vscode built-in outline.

![version](https://vsmarketplacebadge.apphb.com/version/Gerrnperl.outline-map.svg?color=8bf7c7&style=flat-square&logo=visualstudio)
![installs](https://vsmarketplacebadge.apphb.com/installs/Gerrnperl.outline-map.svg?color=56b6c2&style=flat-square&logo=visualstudiocode)
Expand All @@ -13,55 +15,50 @@ A visual, interactive outline map that combines the clarity of the outline with

## Features

- ### Follow the cursor
![Follow the cursor](images/follow-cursor.gif)
- ### Quick navigation
![Quick navigation](images/quick-navigation.gif)
- ### Automatically scroll, expand and collapse the outline tree
![follow](screenshots/follow.gif)
- ### Navigate through the outline
![navigation](screenshots/nav.gif)
- ### Flag diagnostics
![Flag diagnostics](images/flag-diagnostics.gif)
- ### Color customization
![Color customization](images/color-customization.png)
![Flag diagnostics](screenshots/diagnostics.gif)
- ### Search the outline (`<Alt-l>`)
- `/<exp>`: Normal
- `?<exp>`: RegExp
- `?<exp>`: Fuzzy

![Search](screenshots/search.gif)

---

## Configuration
Changes will take effect after restarting the outline view
- `outline-map.color`: color table for specific symbols
- `outline-map.enableAutomaticIndentReduction`: Enable automatic reduction of child node indent when parent node label goes out of view
<br/> ![no-reduceIndent](images/no-reduceIndent.png) -> ![reduceIndent](images/reduceIndent.png)

- `outline-map.follow`: Scroll the outline when the cursor moves or the viewport scrolls
- `viewport`: When scrolling, the center outline node in the visible area of the editor will be scrolled to the center of the outline view;
- `cursor` (default): When the cursor position changes, the outline node where the cursor is located will be scrolled to the center of the outline view;
- `cursor-always-open`: Follow the cursor, manually expand/collapse the outline

- `outline-map.hiddenItem`: Choose items you do not want to see in the outline.

- `outline-map.defaultMaxDepth`: Set the default maximum depth of the outline tree. Set this to non-zero to enable the depth button `>` & `<`.
- `outline-map.expandOutlineMethod`<br/> Set how to expand outline node.
- `click` (default): Click the icon of a outline node to expand;<br/>![click-expand](images/click-expand.gif)
- `hover`: Hover a outline node to expand;
- `outline-map.customFont`: Set the font of the outline view. Example: `Consolas, "Courier New", monospace`.
- `outline-map.customCSS`: custom css for the outline. You could use `Help->Toggle Developer Tools` to see class of elements. If some style does not take effect, you can add `!important` to the rule.

- `outline-map.customFont`: Custom font for the outline. Syntax: `[ <family-name> | <generic-family> ]#`

- `outline-map.customCSS`: Custom css for the outline. The css will be injected into the outline's webview.

## Commands
- `outline-map.focusOutline`: Focus outline and start searching or navigating

- `outline-map.addDepth` | `outline-map.reduceDepth`: Add / Reduce a level to the outline tree. Only works when `outline-map.defaultMaxDepth` is set to non-zero.

- `outline-map.pin` | `outline-map.unpin` | `outline-map.freeze` : Pin / Unpin / Freeze the outline tree.
- `unpin`: Free the outline tree;
- `pin`: The outline tree will not be automatically expanded;
- `freeze`: The outline tree will not be automatically expanded and will not scroll when the cursor moves or the viewport scrolls;

---

## Suggestion: move view to secondary side panel (vscode ^1.64)
![Initialize settings](images/init.gif)

---

> Outline Map relies on (vscode || other extensions) to provide symbol information
> If you meet issues that outline can not display / display wrongly for **a specific file type**, please check if the built-in outline supports the file type.
> - **No**: Please install a extension that provides correct symbol information.
> - **Yes**: Report an [issue](https://github.com/Gerrnperl/outline-map/issues) with the problem file and installed related extensions.
> Refer to the following links for more information: [vscode-code-outline/language-support](https://github.com/patrys/vscode-code-outline#language-support)
>
> Refer to the following links for more information: [vscode-code-outline/ language-support](https://github.com/patrys/vscode-code-outline#language-support)
---

Expand Down
51 changes: 27 additions & 24 deletions README_ZH_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

[EN](README.md) | 中文

可视, 可互动的大纲地图, 提供大纲的清晰条理与缩略地图的直观概览.
![overview](screenshots/overview.png)

可视, 可互动的大纲地图, 提供大纲的清晰条理与缩略地图的直观概览. 改进 VSCode 内置大纲.

![version](https://vsmarketplacebadge.apphb.com/version/Gerrnperl.outline-map.svg?color=8bf7c7&style=flat-square&logo=visualstudio)
![installs](https://vsmarketplacebadge.apphb.com/installs/Gerrnperl.outline-map.svg?color=56b6c2&style=flat-square&logo=visualstudiocode)
Expand All @@ -13,35 +15,40 @@

## 特性

- ### 跟随光标
![Follow the cursor](images/follow-cursor.gif)
- ### 自动滚动, 展开与折叠大纲
![follow](screenshots/follow.gif)
- ### 快速导航
![Quick navigation](images/quick-navigation.gif)
- ### 标记诊断
![Flag diagnostics](images/flag-diagnostics.gif)
- ### 自定义颜色主题
![Color customization](images/color-customization.png)
![navigation](screenshots/nav.gif)
- ### 标记Error与Warning
![Flag diagnostics](screenshots/diagnostics.gif)
- ### 搜索 (`<Alt-l>`)
- `/<exp>`: 正常搜索
- `?<exp>`: 正则表达式
- `?<exp>`: 模糊搜索

![Search](screenshots/search.gif)

---

## 设置
更改将在重启大纲视图后生效

- `outline-map.color`: 为特定符号设置颜色
- `outline-map.enableAutomaticIndentReduction`: 当父节点超出视图范围时减少子节点的缩进<br/>![no-reduceIndent](images/no-reduceIndent.png) -> ![reduceIndent](images/reduceIndent.png)
- `outline-map.follow`: 设置大纲视图自动跟随光标|视口
- `viewport`: 当滚动代码时, 编辑器可视区域的中间节点会被滚动至大纲视图中心, 自动展开/折叠大纲;
- `cursor` (默认): 当光标移动时, 光标所在的节点会被滚动至大纲视图中心, 自动展开/折叠大纲;
- `cursor-always-open`: 跟随光标, 手动展开/折叠大纲
- `outline-map.hiddenItem`: 选择隐藏大纲视图中的节k

- `outline-map.hiddenItem`: 选择隐藏大纲视图中的项目

- `outline-map.defaultMaxDepth`: 设置默认最大深度. 将其设置为正值以启用命令按钮 `>` & `<`.
- `outline-map.expandOutlineMethod`: 设置大纲视图展开方式
- `click` (默认): 点击图标展开<br/>
![click-expand](images/click-expand.gif)
- `hover`: 鼠标悬停时展开;
- `outline-map.customFont`: 设置自定义字体. 例: `Consolas, "Courier New", monospace`
- `outline-map.customCSS`: 设置自定义CSS. 使用 `帮助->切换开发人员工具` 来查看元素的类名. 如果某些规则不起作用, 可以加上`!important`.

- `outline-map.customFont`: 设置自定义字体. 语法: `[ <family-name> | <generic-family> ]#`

- `outline-map.customCSS`: 设置自定义CSS. 这些CSS会被插入大纲的Webview视图

## 命令

- `outline-map.focusOutline`: 聚焦大纲以开始导航与搜索. 默认键位 `<Alt-l>`

- `outline-map.addDepth` | `outline-map.reduceDepth`: 增加 / 减少大纲的一级. `outline-map.defaultMaxDepth` 为正值时可用.
- `outline-map.pin` | `outline-map.unpin`: 固定 / 取消固定 / 冻结大纲视图.
- `unpin`: 取消固定大纲视图;
Expand All @@ -56,11 +63,7 @@
---

> Outline Map 依赖于 vscode 或 其他扩展提供符号信息
> 出现**个别类型文件**大纲无法显示/显示错误的情况请检查内置大纲是否支持该语言
> - ****:请寻找相关扩展提供正确符号信息
> - ****:提交[issue](https://github.com/Gerrnperl/outline-map/issues), 附带问题文件和安装的相关扩展。
>
> 参考: [vscode-code-outline/language-support](https://github.com/patrys/vscode-code-outline#language-support)
---

Expand Down
Binary file removed images/after.gif
Binary file not shown.
Binary file removed images/before.gif
Binary file not shown.
Binary file removed images/changeDepth.gif
Binary file not shown.
Binary file removed images/click-expand.gif
Binary file not shown.
Binary file removed images/color-customization.png
Binary file not shown.
Binary file removed images/details-1.png
Binary file not shown.
Binary file removed images/details-2.png
Binary file not shown.
Binary file removed images/flag-diagnostics.gif
Binary file not shown.
Binary file removed images/follow-cursor.gif
Binary file not shown.
Binary file removed images/init.gif
Binary file not shown.
Binary file removed images/no-reduceIndent.png
Binary file not shown.
Binary file removed images/quick-navigation.gif
Binary file not shown.
Binary file removed images/reduceIndent.png
Binary file not shown.
Loading

0 comments on commit 9fc68b4

Please sign in to comment.