Git Product home page Git Product logo

flatbuffers-intellij-plugin's People

Contributors

jsonmona avatar stefansjs avatar stefansullivan avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jsonmona

flatbuffers-intellij-plugin's Issues

Performance tuning of the parser

The 0.1.1 version of the plugin is rather slow with parsing and syntax highlighting. I'll want to do some performance tuning using features of the grammarkit bnf grammar. Additionally, a lot of syntax highlighting fails when some statements are incomplete.

Tuning Subtasks

  • Implement recoverWhile tuning for better error highlighting
  • Cache reference finding
  • Serialize named element to stub tree

References

GrammarKit example

https://github.com/JetBrains/Grammar-Kit/blob/master/grammars/Grammar.bnf?source=c#L53

GitHub Actions needs some love

GitHub Actions has made many updates since the last build of this plugin. Investigate and update GitHub Actions for building the plugin:

Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: actions/checkout@v2, actions/setup-java@v1, actions/cache@v2, actions/upload-artifact@v2

The set-output command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

The save-state command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Support for Multiline Comments

Currently the parser errors when parsing multi-line comments inside of flatbuffer files e.g. something like:

namespace blah;

/**
 * Test
 *
 * Describes test in more detail
 */
table Test {
  /**
   * The ID of this connection.
   */
  a:string;
}

Add support for namespaces

My first thought is to actually make a namespace part of the PSI hierarchy. I think this is how the flatbuffers compiler parses namespaces. I will need to investigate how reasonable this is

Syntax error is reported for attributes applied to `union` types

With the following Flatbuffer schema (which flatc is happy to consume):

attribute "MyAttribute";

union MyOneUnion (MyAttribute) {
  MyOneUnionFirst,
  MyOneUnionSecond,
}
table MyOneUnionFirst {
}
table MyOneUnionSecond {
}

I get an error reported by the plugin:

flatbuffers.LCURLY expected, got '('

Just want to say that it's a very helpful plugin! Thank you for the effort you've put into it. :)

Table fails when field names are reserved keywords

First of all, thumbs up for the plugin.

I've just noticed the parser fails when a reserved keyword is used as a field name. This is perfectly valid flatbuffers schema:


table Typeful {
	id           : uint64	;
	int          : int		;
	int8         : int8		;
	int16        : int16	;
	int32        : int32	;
	int64        : int64	;
	uint         : uint		;
	uint8        : uint8	;
	uint16       : uint16	;
	uint32       : uint32	;
	uint64       : uint64	;
	bool         : bool		;
	string       : string	;
	stringvector : [string]	;
	byte         : byte		;
	ubyte        : ubyte	;
	bytevector   : [byte]	;
	ubytevector  : [ubyte]	;
	float32      : float32	;
	float64      : float64	;
	float        : float	;
	double       : double	;
}

Implement block folding

Some languages allow you to collapse the function/class block in the IDE. I don't yet know what this involves, but probably involves changing the parser to identify where the curly braces start/stop

Tuning of Error Parsing

When the parser/lexer fails it tend to fail catastrophically. Use the pin and recoverWhile attributes of the flatbuffers grammar to make better error-handling when parsing.

  • use recoverWhile to parse until the } of table/enum/struct declarations
  • use recoverWhile to parse until the ; of field declarations

recoverWhile depends on the proper use of the pin attribute. This will take quite a bit of testing and unit testing the results may be brittle to each individual change. We'll need unit tests that have partial parsing failures to ensure that recovery happens in the way people would reasonably expect

Support for fixed size arrays

Hi,
Consider such schema

struct F
{
  f: [int:16];
}

which is fixed size array is allowed. However, the plugins highlight this part as an syntax error.

Rename refactoring doesn't work

Rename refactoring doesn't work when clicking on a referenced type. Rename refactoring is not available for declarations.

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.