GithubHelp home page GithubHelp logo

vscode-color-identifiers-mode's Introduction

Color Identifiers for Visual Studio Code

Color Identifiers is a syntax highlighter that gives each identifier a different color, inspired by Color Identifiers Mode for Emacs.

Features

This extension works for any language that offers semantic highlighting in Visual Studio Code. It uses the language server to determine which words to highlight.

Two themes, Color Identifiers Dark and Color Identifiers Light, are included. These themes make variables more prominent and language keywords less prominent. Color Identifiers is also compatible with any existing theme.

feature X feature X

Extension Settings

This extension contributes the following settings:

  • colorIdentifiersMode.tokenKinds: The types of language tokens that should have a color applied.
  • colorIdentifiersMode.paletteMode: Automatic or manual. The automatic palette chooses colors that are likely to work well with the active color theme. The manual palette chooses colors from a user-defined list.
  • colorIdentifiersMode.manualColors: The list of colors used in the manual palette mode.
  • colorIdentifiersMode.ignoredLanguages: Don't colorize files in these languages.
  • colorIdentifiersMode.method: Sequential or hash. Sequential mode assigns colors to identifiers in the order the identifiers appear in the file. Hash mode uses the variable's name to decide its color.
  • `colorIdentifiersMode.ignoredFileSize": Ignore files greater than this size in bytes.

vscode-color-identifiers-mode's People

Contributors

hugomcphee avatar mnespor avatar sr-tream avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

vscode-color-identifiers-mode's Issues

.toString() and .toLocaleString break colors

adding .toString() to .toLocaleString() , or any other built-in object prototype key in the code stops the colors from showing.

 stack trace: TypeError: dictionary[key].push is not a function
	at Object.pushValue (c:\Users\pinec\Documents\GitHub\vscode-color-identifiers-mode\out\pushValue.js:6:25)

to recreate the error in a ts file (may need to tab out and back into the file to see the change):

const hello = "hello".toString()
const hello = "hello".toLocaleString()

these don't cause an issue:

const hello = "hello".tttoString() // mistyping toString
const hello = [].sort() // other built in methods are okay

The reason was this part in pushValue.ts was finding "toString" already defined in dictionary so assumed the array was defined

if (key in dictionary) {
  dictionary[key].push(value)

have added a fix PR

not working for me in Go and I don't know how to debug this

Hi! I'm trying this out, and after a bit of study, I've concluded that it works for me in Python and Clojure, but in Go, I just get all identifiers white. I don't know enough of what's going on to usefully debug this. I have a Go language server installed and it seems to work for other purposes (like looking up docs). I've experimentally added most of the tokenKinds to the list of token kinds, which seems not to change anything. I don't understand vscode extensions well enough to know how to proceed from here. I assume I'd want to check whether given tokens were being identified at all, and if so with what type, maybe?

Not applied when file is opened at vscode startup

I am seeing an issue where:

  1. Exit vscode with a file open
  2. Start vscode (it should re-open the file)
  3. Highlighting is applied to tokens (default behavior) rather than variable names

If I save or open a file after vscode has already started then highlighting is applied as expected.

Not working in jupyter notebook.

Thank you for this extension.
I have found a missing feature. It doesn't work in vscode jupyter notebook file (aka .ipynb file).

image

Big files support

This extension colorize all tokens on file open, and it may b slower on big files. Please colorize only visible part or add option to ignore big files. Thanks

Update to new TypeScript requirements

It seems some of the code may not be working. I believe some of the beautiful null coalescing && lines that end && [] are now evaluating to never[] rather than null or undefined

I could not get a ternary operator to do what I wanted either.

I have only been writing Typescript a few days now, so perhaps there is a better way. I ended up rewriting it as

var checkThing: string | undefined = thing()
var anyThing: any = checkThing
var myString: string
if (checkThing !== undefined) {
  myString = (anyThing as string)
} else {
  myString = ""
}

OpenVSX Publishing?

Hey there!

I absolutely love this extension, but I have a small request, would it be possible for you to publish it to the OpenVSX Marketplace? Docs on how to do so are here: https://github.com/eclipse/openvsx/wiki/Publishing-Extensions

I can use it fine on my desktop but some of my friends who use web based IDEs like GitPod are unable to as they don’t have the official MS marketplace :(

Thank you!

provideDocumentSemanticTokensLegend not in VS Code API?

I was having some issues with the plugin recently and couldn't find provideDocumentSemanticTokensLegend in the VS Code API documents. Does that call still exist?

Appears that provideDocumentSemanticTokens is fine, but since it only returns a numeric table there is no way to determine if the number corresponds to a variable, parameter, or property.

There are really computationally complex solutions like cross referencing the DocumentSemanticTokens against the entire document, and then assigning a variable + its semantic token type to a hash of unique colors - except then every token gets a color - rather that just what is useful.

Thankyou

Thanks for making this!

it helps a bunch, and had been a main reason for not switching to vscode from atom (with semanticolor),

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.