Code Monkey home page Code Monkey logo

vscode-guides's Introduction

Guides

A Visual Studio Code extension for more guide lines

Version Installs Ratings

develop master
develop build master build
develop coverage master coverage

Hey There! This is a development build for potential next major release.

For current stable release, please check out master branch.

To see what could be implemented in the upcoming release, check out a list of potential extension options.

Screenshot

What is Guides?

Guides is simply an extension that add various indentation guide lines

How Guides different from built-in indentation guides?

  • Stack and Active indentation guides
  • Indentation backgrounds
  • Color and style customizations
  • Hide on selection

If you just want simple indentation guides, Guides kindly recommends that you use the built-in indentation guides instead.

How it works?

Simply install the extension and reload, Guides should do its job right away!

Note that all guide lines only show when the text is exceeding the limit due to the extension API limitation.

Customizations

Please take a look at preferences to see all available options. Possible values can be access via auto-completion dialog. The following options might affect how Guides performs...

  • guides.indent.backgrounds:
    This settings may cause slow performances on multiple indentations. Each color will be used for each indentation level and will loop around itself. Value must be in rgba(red, green, blue, alpha) format

  • guides.limit.maximum:
    Set to -1 for unlimited maximum rendering boundary.
    Set to floating point between 0 and 1 will based the limit from document size. For example, 0.5 will render guides covered at maximum of 50% in current document.
    Set to 1 or more to render at maximum of specified number of lines.

  • guides.overrideDefault:
    Set to true to suppress any suggestion towards default Visual Studio Code behaviours.

FAQs

Q: Why are guide lines fragmented on empty lines?
A: Guides use borders to draw its guide lines which require a character to be there. Since Visual Studio Code API does not provide the API for drawing line on empty space, this can be expected.

Q: What is the different in each guide line type?
A:

  • Normal indentation guide is a line that run down along each indentation level.
  • Active indentation guide is a line that run down along the last indentation level of the current line.
  • Stack indentation guide is a line that run down along each indentation level that comes before the active indentation level.

Q: License?
A: MIT, however, giving a mention is much appreciated.

vscode-guides's People

Contributors

carlinmack avatar dependabot[bot] avatar sirisak-lu avatar spywhere avatar tyriar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vscode-guides's Issues

Extension(v0.2.2) fails to load on startup in vscode v1.0.1-insider (Win7)

Hi There,

first of all 👍 for this extension.

If i start vscode v1.0.1-insider the indent guides aren't visible anymore.
Here is the corresponding callstack:
image

This is because this.configurations.get here and here returns undefined so the forEach loop fails.

I havent set any of the Guide settings in my custom user settings. I testwise added undefinded checks for this.configurations.get and the extension starts working again. Maybe there was an api change for this.configurations.get from the vscode folks.

Thanks again

Option arrays need defaulting.

Both the "guides.indent.backgrounds" and guides.rulers" aren't being defaulted, so not adding them to the user settings results in exceptions as depicted below.

guides error

Cursor-based guide lines

I prepared some screenshots, which shows where the guide is (green dashed line) and where I expected it (red line):

OK:

ok

🚫 Wrong:

wrong

🚫 Wrong (where is the guide?!)

wrong
wrong

🚫 Wrong:

wrong

🚫 Wrong:

wrong

For example how should it work (in my opinion), please check how work BracketHighlighter for Sublime Text.
I've tested it on VS Ccode 1.16.0 & Mac OS.

Guides show warning when it auto disable itself

1
VS CODE version: 1.13.0
Guides extension has detected that you are using "editor.renderIndentGuides" settings. Guides will now disable all indentation guides by override the style to "none".

Guides Not Working

Guides have recently stopped working for me... Following is the warning that I've started seeing:

Warn Guides extension has detected that you are using "editor.renderIndentGuides" settings. Guides will now disable all indentation guides by override the style to "none".

`Guides` reports an error if you use HEX-colour fot guides.indent.backgrounds

  • I have search open issues for duplicate issues
  • I have search close issues for potential fixes
  • Guides Version: 0.9.3
  • VSCode Version: 1.44.0
  • OS Version: macOS Catalina v10.15.3

Steps to Reproduce:

  1. add an element to guides.indent.backgrounds in a different format than:
rgba(RRR, GGG, BBB, float:A)`

like any hex-value. eg. #RGBA or #RRGGBBAA

Actual Behaviour:

The settings-editor and -JSON will display an error:

String does not match the pattern of "rgba\s*(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*(\d(.\d+)?|.\d+)\s*)".

vs-code will display it correctly, tho.

Expected Behaviour:

that the extention should not report an error for using standard vs-code colour notation

Guidelines don't get rendered after scrolling

  • I have search open issues for duplicate issues
  • I have search close issues for potential fixes
  • Guides Version: 0.9.3
  • VSCode Version: 1.63.2
  • OS Version: Darwin arm64 21.2.0

Steps to Reproduce:

  1. Open a new file that has ~1000 lines
  2. Scroll down (or up) to line 500-ish
  3. Observe the rendering issue

The only way to trigger re-render lines is to click somewhere in the file

Actual Behaviour:
image

Expected Behaviour:
image

Disappear lines

Hi,
in new VC 1.5.3 after open editor lines show up in js file. Any action in the editor makes it disappear and never show up.

Paul.

Determine guide color based on starting line content

This is a feature request which I think would fit this extension. Although it might go beyond the scope of it.
The idea comes from Visual Studio's Structure Visualizer Extension.

The extension for Visual Studio colors the indent guides differently based on the type of the block.
For instance, loops result in a red colored indent guide, while ifs do have a green one:

image

So, while I don't think there is currently no way to reliably determine whether a given block is a loop or a conditional, a filetype based regex could probably suffice. What do you think?

feature request: arrays for indentation guides

Great plugin.

I'd like normal, stack, and active guides to accept arrays as you've done with backgrounds. Then you could do something like:

"guides.stack.color.dark": [
  "rgba(252, 30, 112, .30)",
  "rgba(166, 226, 46, .30)",
  "rgba(96, 211, 232, .30)",
  "rgba(253, 151, 31, .30)"
],

"guides.active.color.dark": [
  "rgba(252, 30, 112, .90)",
  "rgba(166, 226, 46, .90)",
  "rgba(96, 211, 232, .90)",
  "rgba(253, 151, 31, .90)"
],

...for an effect like:

lines idea

Extension is pretty much in maintenance mode

Thank you for using this extension and your time reading this message.

Since my active code editor is no longer a VSCode, I haven't got enough time to maintain my own extensions (as I'm always used my own extensions). So to make it clear and set the expectation, this extension will be less active over time.

However, I might made some changes here and there for low hanging fruits and would be happy to help anyone who want to submit a PR.

For bugs, only a major bug that cause a crash or unavoidable performance issue would be considered. Minor bugs or bugs that have a workaround would not get much attention.

Language-Specific Guides

if i don't like guides in some language type (like js), currently i can't configure that i don't like to see guides in the same.

Make gutter glyphs vector

  • I have search open issues for duplicate issues
  • I have search close issues for potential fixes
  • Guides Version: 0.9.1
  • VSCode Version: 1.24.1
  • OS Version: macOS High Sierra 10.13.5

Steps to Reproduce:

  1. open VSCode
  2. zoom in

Actual Behaviour:
closing and opening gutter brackets appear blurry

Expected Behaviour:
pixel sharp vector indicators

getaddrino ENOTFOUND api.digitalparticle.com

Hi,

I'm investigating a performance issue that's quite similar to #6 input lag for typing. When I open the dev tools I'm seeing lots of these errors:
image

I have no issue with sending usage stats, but will turn this off until it's corrected.

Thanks,
Eugene

[Renewal] Guides skip blank lines

Hello

I know about previous ticket ( #1 ) but it was quite a long time ago, so I would like to ask if something has changed?

Is it now possible to fix it and show indent on empty lines?

Extension causes high cpu load

  • Issue Type: Performance
  • Extension Name: guides
  • Extension Version: 0.9.3
  • OS Version: Windows_NT x64 10.0.18932
  • VSCode version: 1.38.0-insider

⚠️ Make sure to attach this file from your home-directory:
⚠️C:\Users\hp\spywhere.guides-unresponsive.cpuprofile.txt [spywhere.guides-unresponsive.cpuprofile.txt](https://github.com/spywhere/vscode-guides/files/3514632/spywhere.guides-unresponsive.cpuprofile.txt)

Find more details here: https://github.com/Microsoft/vscode/wiki/Explain:-extension-causes-high-cpu-load

Wrong Line highlighted

Hi,
when I clicked a node (the nav in the image beneath) the line of its parent is highlighted,
should't be the line highlighted of the clicked div ?

Editor guidelines

This may not be something you want to do but I'd like to suggest it.

I like to have guidelines at character columns 79 and 120 to help me organise the line-lengths of my code.

Is this something that Guides could add? Or is it already covered by another VSCode plug-in?

For example, in Visual Studio I use “Editor Guidelines” [https://visualstudiogallery.msdn.microsoft.com/da227a0b-0e31-4a11-8f6b-3a149cf2e459].

[Again] Some of guide lines are not straight

Some of guide lines are not straight. It may be active of non-active line, as you can see on screenshots below.

There is a question in this closed issue about other extensions installed by user when trouble appears. I test the behavior of Guides with all other extensions disabled but non-correct line rendering appears in this case too.

screenshot_1
screenshot_2

display 'only active line' as example in README.md

  • Guides Version:0.9.2
  • VSCode Version:1.29.1

For some people, displaying all the vertical lines is ugly, but displaying only the active line is really helpful.

Instead of having to implement a new feature (and maintain code later, bugs, vscode changes, and so on...), this feature can be achieved with the current settings easily.

If you feel that it could be useful for people, adding the settings example in the readme (or a gif file) should be enough. If not interesting, just close the issue, no problem, I'll document it in personal storage because to me it is really nice.

settings.json in vscode:

{
  "guides.active.color.dark": "rgba(100, 100, 100, 0.5)",
  "guides.normal.enabled": false,
  "guides.stack.enabled": false,
}

Example:

vscode-gides_1line

Feature Request: Make Position of Line Customizable

It would be nice if the position of the currently active line (or all lines for that matter, but I don't use the other ones) could be customized. Currently, the line is always drawn on the left side of the spaces / tab. I'd really like to have it displayed on the right side instead, as seen in the middle of this image:
image

Settings / Configurations description is unclear

Maybe this is more common dev knowledge than I have or something but I'm not entirely clear on the differences between active, stacked, and normal. Also, I don't seem to be seeing any real changes to my guides no matter what I do to my settings.

Make active guide highlight according to the cursor position

The extension always highlights the containing block of the line you're on.

But when the caret is right after the opening or right before the closing of an instruction block (brackets, parenthesis, etc.), I think it should consider being "inside" of the instruction block, thus highlighting the next indentation level instead.

This could also apply to multiline function calls, array declarations, etc. to easily find the boundaries of these.

The current behavior:
wrong

The guide that should be highlighted instead:
right

Does this sound logical, and is it feasible ?

Guides skip blank lines

If i have a code bracket with blank lines in it for code separation and readability the guides lines have holes in them. I did not see an option to span across blank lines. Can you please add that. Also explain what rulers are.

besides that. Great Extension

Unindented comment lines break scope

Unindented comment lines break code scope recognition. It is actual for different languages, e.g. Python or Java.

  • I have search open issues for duplicate issues
  • I have search close issues for potential fixes
  • Guides Version: 0.9.1
  • VSCode Version: 1.20.1
  • OS Version: Windows 7 and 10

Steps to Reproduce:

  1. Add comment line without any indentation to the middle of some scope, so that this comment split scope's code on two parts.
  2. Set cursor to the first (before comment) or second (after comment) part of the scope's code.

Actual Behaviour:
actual

Expected Behaviour:
expected

Can Guides or the default editor change location of the expansion buttons? And Active Guide styling doesn't seem to work for me.

  • [x ] I have search open issues for duplicate issues
  • [x ] I have search close issues for potential fixes
  • Guides Version: 0.9.1
  • VSCode Version: 1.2.1
  • OS Version: Windows 10

Here's a peek at what my editor looks like:
image

Is it possible to have the little expanding boxes rendered next to the indent they're at instead at the edge of the screen?

I also don't see the active guide styling mentioned in the settings. It is turned on though. That should mean whatever bracket I'm in get's styled a certain way right?

Extension issue

  • Issue Type: Bug
  • Extension Name: guides
  • Extension Version: 0.9.3
  • OS Version: Darwin x64 18.2.0
  • VSCode version: 1.33.1

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

Setting "normal.enabled" to false still shows normal lines

  • I have search open issues for duplicate issues
  • I have search close issues for potential fixes
  • Guides Version: 0.9.1
  • VSCode Version: 1.22.1
  • OS Version: OSX 10.12.6

Steps to Reproduce:
I only want to see active lines, i.e. the lines on the block where my cursor is. I set these options in my user settings.

"guides.active.enabled": true,
"guides.normal.enabled": false,
"guides.overrideDefault": true,

Actual Behaviour:
I still get all of the lines.

Expected Behaviour:
I only expected to see the active lines when I was on a block. IOW, in this screen shot, I expected only the red "active" line to show. That is the behavior I am looking for. Are the above settings not how to accomplish it?

vscode guides

TypeError: Cannot read property 'document' of undefined

From our error telemetry:

TypeError: Cannot read property 'document' of undefined
at Guides.updateEditor (/home/a123/.vscode-insiders/extensions/spywhere.guides-0.0.3/out/src/extension.js:71:41)
at GuidesController.updateEditor (/home/a123/.vscode-insiders/extensions/spywhere.guides-0.0.3/out/src/extension.js:23:21)
at e.invoke (/usr/share/code-insiders/resources/app/out/vs/workbench/node/pluginHostProcess.js:7:14035)
at e.fire (/usr/share/code-insiders/resources/app/out/vs/workbench/node/pluginHostProcess.js:7:15488)
at e._acceptActiveEditorAndVisibleEditors (/usr/share/code-insiders/resources/app/out/vs/workbench/node/pluginHostProcess.js:19:7974)
at e._acceptTextEditorRemove (/usr/share/code-insiders/resources/app/out/vs/workbench/node/pluginHostProcess.js:19:8379)
at t.e.handle (/usr/share/code-insiders/resources/app/out/vs/workbench/node/pluginHostProcess.js:15:12687)
at c (/usr/share/code-insiders/resources/app/out/vs/workbench/node/pluginHostProcess.js:11:16222)
at h (/usr/share/co

Extension issue

  • Issue Type: Bug
  • Extension Name: guides
  • Extension Version: 0.9.3
  • OS Version: Windows_NT x64 10.0.19042
  • VS Code version: 1.56.2

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

New line dissapears

Hi,

I'm somehow a sucker for leaving white space on my code, mainly blank lines in my code to make it easier to read and follow. The thing is that those new lines are not highlighted. Something like this:

function myFunc(){

|  // some code here then a blank line

|  var a = 0:
|  var b = 1;

|  return a+b;

}

Happens in all file extensions I've checked so far, but the normal behaviour from vs code actually renders those blank lines correctly. Like this:

function myFunc(){
|
|  // some code here then a blank line
|
|  var a = 0:
|  var b = 1;
|
|  return a+b;
|
}

Is extension deprecated?

  • I have search open issues for duplicate issues
  • I have search close issues for potential fixes
  • Guides Version:
  • VSCode Version:
  • OS Version:

Steps to Reproduce:

  1. Install extension
  2. Get warning message

Actual Behaviour:
"Guides extension has detected that you are using "editor.renderIndentGuides" settings. Guides will now disable all indentation guides by override the style to "none"."

Expected Behaviour:
Work properly after you install extension

Active gutter icon cut off

  • Guides Version: 0.8.3
  • VSCode Version: 1.13.1
  • OS Version: Mac OS 10.12.5

As you can see below the active gutter icon that points left is cut off. Can you please fix this? Thanks!

counter_js_ _autostradaforum_com

Extension issue

  • Issue Type: Bug
  • Extension Name: guides
  • Extension Version: 0.9.3
  • OS Version: Windows_NT x64 10.0.18363
  • VSCode version: 1.41.1

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

Brackets projection on gutter

It's much easier to notice the brackets area, while there is a projection on gutter. Here some exaples how it might look like.

2ff6a12e-dd8f-11e6-9624-d6f7b54d0337 1

or

47924d34-c10a-11e6-909a-8c31fed90919 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.