Code Monkey home page Code Monkey logo

Comments (6)

jonas-jonas avatar jonas-jonas commented on July 23, 2024

Does LSP4E support snippets from the language server? If so, it would be nice to implement this in the Dart analysis server instead of rolling our own snippets.

cc @mickaelistria

from dartboard.

mickaelistria avatar mickaelistria commented on July 23, 2024

I am not sure what is the difference between a code snippet and a completion proposal. Can you please describe in a user-story what you mean by code snippet?

from dartboard.

jonas-jonas avatar jonas-jonas commented on July 23, 2024

I'm talking about https://github.com/Microsoft/language-server-protocol/blob/master/snippetSyntax.md. I might be misunderstanding it though.

Ultimately this would boil down to a user wanting to have the import '' statement written out for him, and then have the cursor placed inside the '' like so: import '<cursor>'. I'm not sure if this is what I'm talking about, because the documentation seems very scarce on the LSP side of things.

This is the LSP spec on this.
LSP4E seems to report true on the snippetSupport parameter, but I couldn't find the code for this. Or is it just a generic completionItem?

completion?: {
		/**
		 * Whether completion supports dynamic registration.
		 */
		dynamicRegistration?: boolean;

		/**
		 * The client supports the following `CompletionItem` specific
		 * capabilities.
		 */
		completionItem?: {
			/**
			 * The client supports snippets as insert text.
			 *
			 * A snippet can define tab stops and placeholders with `$1`, `$2`
			 * and `${3:foo}`. `$0` defines the final tab stop, it defaults to
			 * the end of the snippet. Placeholders with equal identifiers are linked,
			 * that is typing in one will update others too.
			 */
			snippetSupport?: boolean;
...

from dartboard.

mickaelistria avatar mickaelistria commented on July 23, 2024

Yes, it does support snippets if you use master branch. See
choiceSnippet

from dartboard.

jonas-jonas avatar jonas-jonas commented on July 23, 2024

Awesome. Thanks for the clarification. I will see if this is something the LS of Dart might provide then.

from dartboard.

jonas-jonas avatar jonas-jonas commented on July 23, 2024

I submitted dart-lang/sdk#37831.

from dartboard.

Related Issues (20)

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.