Giter VIP home page Giter VIP logo

vscode-languageserver-protocol-foldingprovider's Introduction

VSCode Language Server Protocol - Folding Provider Extension (Proposed)

This repository contains the documentation and APIs of the Folding Provider extension to the Language Server Protocol.

  • Documentation of the added request, types and capabilities.
  • TypeScript APIs for consumption of clients and servers implemented in Typescript.

This extensions is currently only proposed and not yet finalized. Please file comments and improvment suggestions here.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

vscode-languageserver-protocol-foldingprovider's People

Contributors

aeschli avatar microsoftopensource avatar msftgits avatar rcjsuen avatar

Stargazers

 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

vscode-languageserver-protocol-foldingprovider's Issues

Improve documentation for folding range type

So FoldingRange.type can be a FoldingRangeType or a string. What is the string supposed to be?

If it's a FoldingRangeType what makes each type special? Are they displayed differently or does it serve a different purpose?

  • If it is supposed to be categorized by source element (presumably so an editor can determine if a region should be collapsed by default or something), can we get more?
    Ex: Collapsing a declaration, heredoc string (like in PHP), or automatically implemented property with a getter/setter (like in C#; which could be collapsed by default).

Should FoldingRangeList have an isIncomplete property

If the client sends a textDocument/foldingRanges request with maxRanges set to 10 and the returned JSON { ranges: [ ... ] } has ten items in ranges, what should happen? Are clients expected to just send another request, increasing the value of maxRanges and see what happens? Or should the server instead be sending something like { ranges: [ ... ], isIncomplete: true } back to the client similar to returning an incomplete CompletionList for a textDocument/completion request?

FoldingRange interfaces don't match and needs more clarification

The Markdown file defines the following:

/**
 * Represents a folding range.
 */
export interface FoldingRange {

	/**
	 * The start line number of the folding range. The first line will stay visible, all folloing lines, including the end line will be folded.
	 */
	startLine: number;

	/**
	 * The end line number. The last line will be hidden.
	 */
	endLine: number;

	/**
	 * The type of folding range.
	 */
	type?: FoldingRangeType | string;
}

The TypeScript file defines the following:

/**
 * Represents a folding range.
 */
export interface FoldingRange {

	/**
	 * The start line number of the folding range.
	 */
	startLine: number;

	/**
	 * The start column of the folding range. If not set, this defaults to the length of the start line.
	 */
	startColumn?: number;

	/**
	 * The end line number. The last line will be hidden.
	 */
	endLine: number;

	/**
	 * The start column of the folding range. If not set, this defaults to the length of the end line.
	 */
	endColumn?: number;

	/**
	 * The type of folding range.
	 */
	type?: FoldingRangeType | string;
}

I'm assuming that the TypeScript one is correct with startColumn and endColumn?

Are "lines" and "columns" zero-based or one-based?

What is a "column"? Is it the space between two characters (similar to the LSP Position)? If it's zero-based and has a value of 0 then it is the beginning of the line? In Windows' Notepad, columns are one-based and a value of 1 puts it at the beginning of the line.

Or is a "column" the actual space that is taken up by a character?

maxRanges needs more documentation to clarify how to use it

The protocol currently states the following:

export interface FoldingRangeRequestParam {
	/**
	 * The text document.
	 */
	textDocument: TextDocumentIdentifier;

	/**
	 * The maximum number of ranges to provide
	 */
	maxRanges?: number;
}

How can a client specify that the server should return "all" possible ranges in the document? Should Number.MAX_SAFE_INTEGER be used? Should a negative number be used? Or should a negative number in maxRanges cause the server to throw an error back to the client?

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.