Giter Club home page Giter Club logo

code-peggy-language's People

Contributors

hildjj avatar joepie91 avatar lionel-rowe avatar nene avatar sanket143 avatar srtobi avatar yy0931 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

code-peggy-language's Issues

Empty outline on newly opened files

Steps to reproduce:

  1. Open a pegjs file
  2. See that the outline is empty:
    image
  3. Only after editing something it gets initialized:
    image

Expected: show all symbols directly after opening

After debugging a bit I found out it was introduced in #33 because validateTextDocument always delays the AST parsing but in the meantime onDocumentSymbol gets called which can't find the cached AST

"Goto/Peek Definition" doesn't work when rule name contains underscores

For example with this grammar:

start = multi_stmt

multi_stmt = (stmt ";")+

stmt = "HELLO"

The Peek Definition functionality works fine with the stmt rule:

peek-stmt

But when I try to peek at the multi_stmt rule, it doesn't work. Further more, when I hover over the stmt part of multi_stmt, it peeks at the stmt rule:

peek-multi_stmt

Similar problem happens when using the $ character inside rule name. In that case even syntax highlighting doesn't consider $ to be part of the name:

peek-dollar

vsce package fails

After #14, vsce package fails with:

[tsl] ERROR
      TS6059: File '[base]//src/main.ts' is not under 'rootDir' '[base]/server/src'. 'rootDir' is expected to contain all source files.
  The file is in the program because:
    Root file specified for compilation
ts-loader-default_bf8b548751077c90

This is why I had removed the tsconfig file in server/, but I'm sure there's a way to solve this that is more correct.

Use webpack

Shut up vsce about it wanting bundling, use example from yo code.

Open VSX

Would it be possible to publish the extension also to Open VSX? That way it can also be used with Gitpod and Theia. This would be really great :-)

"Goto/Peek Definition" doesn't work for proxy rules

When trying to look up definition of a proxy rule, none is found:

Screenshot 2022-11-18 at 15 12 20

This likely happens because the rule gets optimized away:

Screenshot 2022-11-18 at 15 13 21

I suppose one can simply refactor the proxy rule away, but I don't really want to do that. It's often helpful to have such proxy rules.

When one just turns off the "Peggy Language Server: Mark Info" config, the squiggly line won't appear under the rule, and it's even harder to diagnose why the lookup fails.

Difficulties using development setup

Hi,

I had some problems when debugging

  • it wouldn't start because the preLaunchTask (which does a webpack watch) would never end and it doesn't have the correct problem watcher that would tell vscode that it finished (I think it's this problem)
  • when I replaced the preLaunchTask with a webpack compile instead of watch it was slow.. making it a little unsettisfying
  • couldn't set breakpoints in server

Inserting file-wide eslint-disable adds star

Cmd-. an eslint error, select "Disable @peggyjs/no-unused-rules for the entire file", you get this added to the top of the file:

/** eslint-disable @peggyjs/no-unused-rules */

This doesn't work because of the extra asterisk at the beginning. What is desired is this:

/* eslint-disable @peggyjs/no-unused-rules */

See https://github.com/microsoft/vscode-eslint/blob/1fa8e21b20f83987d349ac500a571194695117a3/server/src/eslintServer.ts#L699 for where the insertion happens. getBlockComment should return [ "/*", "*/" ] as far as I can see, so I don't know why this is happening.

Collaborate with vscode-pegjs

See repo

@tamuratak do you have any interest in collaborating? We're re-invigorating Peg.js as Peggy, and in my opinion it would be great if we had one VSCode plugin that was a superset of the options the Peg.js world had.

Custom icon for `.peggy` and `.pegjs` files

File extension icons can be specified by VS Code themes, but less-common extensions usually don't get this treatment. That means that in most (probably all) themes, .peggy and .pegjs files just use the default icon for unknown file types, which makes it hard to visually distinguish them at a glance:

image

If a theme doesn't specify a theme for a file extension, the associated VS Code extension can specify a default one. I suggest reusing the favicon from the peggyjs/pegjs site for this purpose, with a colorized version for dark themes.

PR to follow.

Slow performance when working on a large grammar file

I'm working with a large grammar file of about 4000 lines (see parser.pegjs). At that size this extension becomes utterly sluggish.

It takes a few seconds to parse and compile the whole file, but the extension attempts to do that at every keystroke. So like when I type 10 characters I'll need to wait like 30 seconds for the extension to finish parsing and compiling the file 10 times in a row. When I write even longer passages of code, it can take several minutes for the extension to catch up.

I don't know what's the best practice for dealing with such long-executing processes in VSCode extension, but I guess something like wrapping the validateTextDocument function call inside a debounce would alleviate a large part of the pain.

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.