Coder Social home page Coder Social logo

wixplosives / stylable-intelligence Goto Github PK

View Code? Open in Web Editor NEW
16.0 40.0 6.0 14.72 MB

Stylable extension for Visual Studio Code

Home Page: https://marketplace.visualstudio.com/items?itemName=wix.stylable-intelligence

License: BSD 3-Clause "New" or "Revised" License

JavaScript 4.31% TypeScript 90.53% CSS 5.16%
css stylable style styling theme theming vscode-extension lsp lsp-server language-server-protocol

stylable-intelligence's Introduction

stylable-intelligence

Visual Studio Marketplace Build Status Visual Studio Marketplace npm version

Overview

Stylable Intelligence is an extension implementing the Language Server Protocol that provides IDE support for Stylable.

Stylable Intelligence is currently only supported in VSCode (version 1.20.0 and later). Support for JetBrains IDEs (WebStorm, IntelliJ) is planned.

Currently supported: Code Completions, Diagnostics, Go to Definition, Syntax Highlighting

All CSS language support functionality is also supported (hover hints, inline color picker, etc.). Some CSS diagnostics were removed in order to support custom Stylable syntax.

Installation

From VSCode Marketplace

Install 'Stylable Intelligence' from the VSCode Extension Marketplace or inside VSCode in the Extension panel, search for "stylable-intelligence".

Known Issues

Known issues may be found in the Stylable Intelligence repo.

Development

Information about running the Stylable Intelligence development enviroment can be found here.

stylable-intelligence's People

Contributors

alexshemeshwix avatar amir-arad avatar arnonkehat avatar avivahl avatar barak007 avatar dependabot-preview[bot] avatar dependabot[bot] avatar greenkeeper[bot] avatar idoros avatar nadavov avatar nadavwix avatar qballer avatar talh78 avatar tempit avatar tomrav avatar

Stargazers

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

Watchers

 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

stylable-intelligence's Issues

Create mechanism for test variants

Use one base case, with variants that:

  1. Add one or ore spaces
  2. Add one or more colons
  3. Add semi-colon at end of string
  4. Replaces spaces with \n and vice-versa

Completions break, and are only restored on save

Open this doc:
.baga {
color: red;
}

::

Place cursor after ::, and ctrl+space - no ':import'. Deleting one or both : and ctrl+space still has no ':import' or '.root'.
Save the doc, type : and ':import' is in the list. Type another :, and it's still in.

E2E needs to use vscode GUI

currently e2e uses the vscode workspace to load files and open an editor, but does not position the caret and call vscode's triggerCompletion command, instead calling the extension itself

AST DRP

When asking for completions, code is usually broken.
This throws PostCSS into a tizzy.
We currently check if the current line is illegal, and ignore this line in parsing.
This is fragile, and does not solve cases where the error is not on the typed line.
Better algorithm suggestion is to identify the problem spots and expand deleted scopes around them until we have valid code.

completion icons

Completions
CompItemKinds for icons:
. - Class
value() -> Variable
-st-named -> (var -> Variable, cls -> Class)
: -> Enum
:vars -> Keyword
:import -> Keyword
-st-* directive -> Keyword

When extension installation fails - show error message

Scenario:

  1. Visual Studio code version was not supported by extension
  2. Installation succeeded, however 'reload' appeared on the extension and reloading did not work.

Solution:
Show an error message like the one below using the existing mechanism:

image

ignore anything that is not *.st.css

Right now the vscode plugin try to work on *.css files, this is annoying when working in a project with no stylable, or on a none stylable file.

Diagnostics

Die, Agnostics!
To be broken down into smaller issues...

Completions E2E tests

  • Stylable completions appear before CSS completions. [Can't be tested in server, no CSS completions]
  • Completions suggest file names from local FS for '-st-from:'. [Can't be tested in server, client loads the files]

CI Hangs forever

Both Jenkins and Travis are hang forever when they are running npm run test command.
Jenkins:
https://cijoe.wixcore3.com/job/build-generic/897/console
Travis
https://travis-ci.org/wixplosives/stylable-intelligence/builds/274689101?utm_source=github_status&utm_medium=notification

Ive isolated issue on Jenkins agent.
internal-jenkins-slave3a.core-3.wixcore3.com

I can see vscode process running in background when test hangs

ps aux | grep vscode output

ubuntu   21536  0.0  0.0  12944  1028 pts/2    S+   07:36   0:00 grep vscode
ubuntu@internal-jenkins-slave3a:~$ ps aux | grep vscode
ubuntu   21648  2.9  0.9 1082840 74804 pts/1   Sl+  07:36   0:00 /home/jenkins-slave/workspace/build-generic/packages/client/.vscode-test/VSCode-linux-x64/code --extensionDevelopmentPath=/home/jenkins-slave/workspace/build-generic/packages/client --extensionTestsPath=/home/jenkins-slave/workspace/build-generic/packages/client/dist/test /home/jenkins-slave/workspace/build-generic/packages/client/test/cases
ubuntu   21650  0.0  0.3 330832 28544 pts/1    S+   07:36   0:00 /home/jenkins-slave/workspace/build-generic/packages/client/.vscode-test/VSCode-linux-x64/code --type=zygote --no-sandbox
ubuntu   21676  0.5  0.7 478500 55220 pts/1    Sl+  07:36   0:00 /home/jenkins-slave/workspace/build-generic/packages/client/.vscode-test/VSCode-linux-x64/code --type=gpu-process --no-sandbox --supports-dual-gpus=false --gpu-driver-bug-workarounds=7,23,74 --disable-gl-extensions=GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent --gpu-vendor-id=0x0000 --gpu-device-id=0x0000 --gpu-driver-vendor --gpu-driver-version --gpu-driver-date --service-request-channel-token=084DCB1699055152DF6670A30EAEBF3D

if i kill all vscode processes and run
/home/jenkins-slave/workspace/build-generic/packages/client/.vscode-test/VSCode-linux-x64/code

it will hang with following message


{ errorCode: 'load',d-generic/packages/client/.vscode-test/VSCode-linux-x64/code
  moduleId: 'keytar',
  neededBy: [ 'vs/platform/credentials/node/credentialsService' ],
  detail:
   Error: libsecret-1.so.0: cannot open shared object file: No such file or directory
       at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
       at Object.Module._extensions..node (module.js:598:18)
       at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
       at Module.load (module.js:488:32)
       at tryModuleLoad (module.js:447:12)
       at Function.Module._load (module.js:439:3)
       at Module.require (module.js:498:17)
       at n (/home/jenkins-slave/workspace/build-generic/packages/client/.vscode-test/VSCode-linux-x64/resources/app/out/vs/loader.js:4:10954)
       at Object.<anonymous> (/home/jenkins-slave/workspace/build-generic/packages/client/.vscode-test/VSCode-linux-x64/resources/app/node_modules/keytar/lib/keytar.js:1:169)
       at Object.<anonymous> (/home/jenkins-slave/workspace/build-generic/packages/client/.vscode-test/VSCode-linux-x64/resources/app/node_modules/keytar/lib/keytar.js:55:3) }

When i run tests locally on my machine i can see error message like this

Error: certificate has expired
    at TLSSocket.<anonymous> (_tls_wrap.js:1088:38)
    at emitNone (events.js:86:13)
    at TLSSocket.emit (events.js:188:7)
    at TLSSocket._finishInit (_tls_wrap.js:610:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38)

So my guess it has some problem with certificate and it causes VScode to crash and not exit in CI environment.

build issues

While installing the extension in a real running vscode I've encountered the following issues:

  • we need to remove adding all files. This adds everything in the node_modules, etc.
  • we need to remove all console.logs and trace since it dumps everything in vscode output.
  • remove trace

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.