SlideShare una empresa de Scribd logo
1 de 34
Descargar para leer sin conexión
How does Intellisense work?
What is Intellisense?
Types of Intellisense
Contextual
Global
Contextual Intellisense
Completions
Tooltips
Signature help
Quick info
Go to definition
CodeLense
Editor decorations
Red squiggle on invalid syntax
Global intellisense
Diagnostics ﴾i.e. errors and warnings﴿
Go to symbol
Find all references
A side‐trip: Compilers
Most compilers have 4 stages:
Lexical analysis ﴾often called lexing﴿
Processing the source text into a sequence of tokens.
Syntax analysis ﴾often called parsing﴿
Parsing the tokens to produce a syntactic model, usually an
Abstract Syntax Tree ﴾AST﴿.
Semantic analysis
Analysing the syntactic model to determine what things mean.
The semantic model varies from language to language.
Generation ﴾generate appropriate artifacts﴿
Worked example ﴾simplified﴿
Lexical analysis
The lexer turns a stream of characters into discrete tokens:
Before:  _count == 5 
After:
 Identifier(_count) 
 Whitespace( ) 
 Operator(==) 
 Whitespace( ) 
 IntegerLiteral(5) 
Syntactic analysis
The parser turns a stream of tokens into an AST.
Before:
 Identifier(_count) 
 Whitespace( ) 
 Operator(==) 
 Whitespace( ) 
 IntegerLiteral(5) 
After:
 EqualityExpression 
 Left :  Symbol(_count) 
 Right :  IntegerLiteral(5) 
Semantic analysis
The compiler refines and interprets the AST.
Before:
 EqualityExpression 
 Left :  Symbol(_count) 
 Right :  IntegerLiteral(5) 
After:
 Equality(ExpressionType:Boolean) 
 Left :  Field(Class1::_count), Type=Symbol(Int32),
Target=This 
 Right :  Int32Literal(5) 
Compiler vs. Language Service
A compiler's job is to transform the source text and generate
outputs.
A language service's job is to understand the source text and
answer questions about it.
The Compiler's job
 'Foo.cs' ‐> 'Foo.exe' 
 'Strings.resx' ‐> 'Strings.resources' 
The Language service's job
"What does the identifier at line 3, column 6 mean?"
"Where is the class  HomeController used?"
Some source text
Let's put on our language‐service goggles!
What does the language service see?
Tokens
Syntax
Quick side‐trip
The cross‐platform problem
The cross‐platform problem
Many editors / IDEs can be used for multiple languages, even when
those languages are built for a different platform / runtime than the
one used by those editors, so the editor can't simply load the
library that implements each language service.
An example of the cross‐platform problem
VSCode is written in TypeScript, and runs on Electron / NodeJS
The C# compiler is written in managed code and runs on the
CLR
So how do we provide a C# language service for VSCode?
An example of the cross‐platform problem
The Go compiler is written in Go and runs natively
So how do we provide a Go language service for VSCode?
Language Server Protocol ﴾LSP﴿
Microsoft have developed a standard protocol for communications
between editors and language services.
Think of it as a WebAPI for Intellisense ﴾without the "web" bit﴿.
OmniSharp
OmniSharp is an out‐of‐process language server that brings C# to a
large number of editors. It does not currently use LSP ﴾mainly
because it existed long before LSP﴿ but there are definite
similarities.
Models for Intellisense
Syntactic model
Semantic model
Syntactic model
The syntactic model is essential for providing contextual
Intellisense; it is used to map text ﴾i.e. editor﴿ positions to nodes in
the AST. This allows you to at least work out what kind of syntactic
element ﴾e.g. identifier﴿ is at the current position.
In some cases, this is enough to work out what kinds of
completions should be offered ﴾e.g. if you're inside an XML
element's opening tag, then you can offer attributes﴿.
Semantic model
The semantic model builds on top of the syntactic model, adding
information about what the syntactic element at the current
position means ﴾e.g. identifier represents a variable, field, or
property﴿.
This allows you ﴾for example﴿ to work out, when on an XML
element's opening tag, which attributes to offer completions for
﴾e.g. from schema﴿.
Error tolerance ﴾robustness vs resilience﴿
To be useful for a language service, it's better for a compiler to err
on the side of resilience rather than robustness; stopping on the
first error without producing at least some kind of model makes it
hard to provide Intellisense once the user starts typing ﴾since the
source text is now probably invalid﴿.
Instead, the compiler should produce an AST that can express
invalid syntax ﴾even if it cannot then be fully processed to generate
a semantic model﴿.
Positioning
Most language services have some form of the following 2
constructs:
Position
One‐dimensional; refers to a specific location in the text.
Range ﴾sometimes called a Span﴿
Two‐dimensional; refers to all text between 2 positions.
Positioning ﴾continued﴿
There are 2 commonly‐used models for positioning:
Absolute ﴾usually 0‐based﴿
Measures the number of characters from the start of the
document.
Can be more efficient, but harder to reason about ﴾especially
when you factor in different line‐endings﴿.
Line / Column ﴾0‐based or 1‐based﴿
Easier to reason about.
Can be less efficient, if you have to translate back‐and‐forth.
Text position ‐> Model
In order to provide contextual Intellisense, you need to be able to
map the current position to something in your model. For this
reason, it is important that your syntactic and / or semantic model
captures positional information.
Additionally, your syntactic model should make it easy to navigate
between its elements ﴾sometimes the current element is not
meaningful by itself and a broader scope needs to be taken into
account﴿.
For example, an XML syntax model should make it easy to move
from an element to its parent, one of its children, or its next /
previous sibling.
Tips for language service developers ﴾1/4﴿
Avoid ad‐hoc parsing, especially at the string level.
Build a syntactic / semantic model, and then build unit‐testable
functionality around it.
Ensure that your semantic model captures what you mean;
ideally you should be able to use it to determine what kind of
intellisense can be offered at a given position.
Also, logging. Lots of logging.
Tips for language service developers ﴾2/4﴿
Configurable all the things:
Developers are picky, and don't like change; if you want to
change the language service behaviour ﴾even when it's a
definite improvement﴿, offer a setting to use the old
behaviour.
If a feature has even the slightest potential to be
annoying, add a setting to turn it off.
Tooltips on hover is a classic example of this.
If you offer completions for standard entities, consider
allowing the user to define their own entities to be offered
alongside the built‐in completions.
Tips for language service developers ﴾3/4﴿
Do what the user expects:
Your language service should be predictable and transparent in
its operation.
Make it easy for the user to predict what your language service
will do in a given context.
Prefer to empower, rather than abstract.
Offer to handle the gruntwork, but don't hide it. Otherwise, the
user won't learn anything.
Tips for language service developers ﴾4/4﴿
Don't try to be too clever
﴾nobody likes a smartarse﴿

Más contenido relacionado

La actualidad más candente

WorkinOnTheRailsRoad
WorkinOnTheRailsRoadWorkinOnTheRailsRoad
WorkinOnTheRailsRoad
webuploader
 
Workin ontherailsroad
Workin ontherailsroadWorkin ontherailsroad
Workin ontherailsroad
Jim Jones
 

La actualidad más candente (19)

WorkinOnTheRailsRoad
WorkinOnTheRailsRoadWorkinOnTheRailsRoad
WorkinOnTheRailsRoad
 
Workin ontherailsroad
Workin ontherailsroadWorkin ontherailsroad
Workin ontherailsroad
 
single pass compiler and its architecture
single pass compiler and its architecturesingle pass compiler and its architecture
single pass compiler and its architecture
 
Introduction to Operational Semantics
Introduction to Operational Semantics Introduction to Operational Semantics
Introduction to Operational Semantics
 
Create Your Own Language
Create Your Own LanguageCreate Your Own Language
Create Your Own Language
 
Compiler lecture 02
Compiler lecture 02Compiler lecture 02
Compiler lecture 02
 
Introduction to Functional Programming
Introduction to Functional ProgrammingIntroduction to Functional Programming
Introduction to Functional Programming
 
Design concerns for concrete syntax
Design concerns for concrete syntaxDesign concerns for concrete syntax
Design concerns for concrete syntax
 
PHP Syntax & Comments
PHP Syntax & CommentsPHP Syntax & Comments
PHP Syntax & Comments
 
CS152 Programming Paradigm
CS152 Programming Paradigm CS152 Programming Paradigm
CS152 Programming Paradigm
 
EMPEX LA 2018 - Inclusion Starts with Docs
EMPEX LA 2018 - Inclusion Starts with DocsEMPEX LA 2018 - Inclusion Starts with Docs
EMPEX LA 2018 - Inclusion Starts with Docs
 
CPP03 - Repetition
CPP03 - RepetitionCPP03 - Repetition
CPP03 - Repetition
 
Language Workbenches
Language WorkbenchesLanguage Workbenches
Language Workbenches
 
Zoo of domain-specific languages
Zoo of domain-specific languagesZoo of domain-specific languages
Zoo of domain-specific languages
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 
Programming with \'C\'
Programming with \'C\'Programming with \'C\'
Programming with \'C\'
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Cd ch2 - lexical analysis
Cd   ch2 - lexical analysisCd   ch2 - lexical analysis
Cd ch2 - lexical analysis
 
Introduction to programming by MUFIX Commnity
Introduction to programming by MUFIX CommnityIntroduction to programming by MUFIX Commnity
Introduction to programming by MUFIX Commnity
 

Similar a How does intellisense work?

Mark asoi ppt
Mark asoi pptMark asoi ppt
Mark asoi ppt
mark-asoi
 
Language translators
Language translatorsLanguage translators
Language translators
Aditya Sharat
 
Basics java scripts
Basics java scriptsBasics java scripts
Basics java scripts
ch samaram
 
Os Keysholistic
Os KeysholisticOs Keysholistic
Os Keysholistic
oscon2007
 

Similar a How does intellisense work? (20)

Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thrift
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...
 
Stay fresh
Stay freshStay fresh
Stay fresh
 
Rust presentation convergeconf
Rust presentation convergeconfRust presentation convergeconf
Rust presentation convergeconf
 
Lecture 1 introduction to language processors
Lecture 1  introduction to language processorsLecture 1  introduction to language processors
Lecture 1 introduction to language processors
 
Mark asoi ppt
Mark asoi pptMark asoi ppt
Mark asoi ppt
 
Language translators
Language translatorsLanguage translators
Language translators
 
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptxUnit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
 
Language Server Protocol - Why the Hype?
Language Server Protocol - Why the Hype?Language Server Protocol - Why the Hype?
Language Server Protocol - Why the Hype?
 
Basics java scripts
Basics java scriptsBasics java scripts
Basics java scripts
 
How a Compiler Works ?
How a Compiler Works ?How a Compiler Works ?
How a Compiler Works ?
 
Switch case looping
Switch case loopingSwitch case looping
Switch case looping
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdf
 
2 Programming Language.pdf
2 Programming Language.pdf2 Programming Language.pdf
2 Programming Language.pdf
 
Swift programming language
Swift programming languageSwift programming language
Swift programming language
 
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
 
Compiler_Lecture1.pdf
Compiler_Lecture1.pdfCompiler_Lecture1.pdf
Compiler_Lecture1.pdf
 
Software_engineering.pptx
Software_engineering.pptxSoftware_engineering.pptx
Software_engineering.pptx
 
Os Keysholistic
Os KeysholisticOs Keysholistic
Os Keysholistic
 
Antlr Conexaojava
Antlr ConexaojavaAntlr Conexaojava
Antlr Conexaojava
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

How does intellisense work?

  • 4. Contextual Intellisense Completions Tooltips Signature help Quick info Go to definition CodeLense Editor decorations Red squiggle on invalid syntax
  • 5. Global intellisense Diagnostics ﴾i.e. errors and warnings﴿ Go to symbol Find all references
  • 6. A side‐trip: Compilers Most compilers have 4 stages: Lexical analysis ﴾often called lexing﴿ Processing the source text into a sequence of tokens. Syntax analysis ﴾often called parsing﴿ Parsing the tokens to produce a syntactic model, usually an Abstract Syntax Tree ﴾AST﴿. Semantic analysis Analysing the syntactic model to determine what things mean. The semantic model varies from language to language. Generation ﴾generate appropriate artifacts﴿
  • 8. Lexical analysis The lexer turns a stream of characters into discrete tokens: Before:  _count == 5  After:  Identifier(_count)   Whitespace( )   Operator(==)   Whitespace( )   IntegerLiteral(5) 
  • 9. Syntactic analysis The parser turns a stream of tokens into an AST. Before:  Identifier(_count)   Whitespace( )   Operator(==)   Whitespace( )   IntegerLiteral(5)  After:  EqualityExpression   Left :  Symbol(_count)   Right :  IntegerLiteral(5) 
  • 10. Semantic analysis The compiler refines and interprets the AST. Before:  EqualityExpression   Left :  Symbol(_count)   Right :  IntegerLiteral(5)  After:  Equality(ExpressionType:Boolean)   Left :  Field(Class1::_count), Type=Symbol(Int32), Target=This   Right :  Int32Literal(5) 
  • 11. Compiler vs. Language Service A compiler's job is to transform the source text and generate outputs. A language service's job is to understand the source text and answer questions about it.
  • 13. The Language service's job "What does the identifier at line 3, column 6 mean?" "Where is the class  HomeController used?"
  • 15. Let's put on our language‐service goggles! What does the language service see?
  • 19. The cross‐platform problem Many editors / IDEs can be used for multiple languages, even when those languages are built for a different platform / runtime than the one used by those editors, so the editor can't simply load the library that implements each language service.
  • 20. An example of the cross‐platform problem VSCode is written in TypeScript, and runs on Electron / NodeJS The C# compiler is written in managed code and runs on the CLR So how do we provide a C# language service for VSCode?
  • 21. An example of the cross‐platform problem The Go compiler is written in Go and runs natively So how do we provide a Go language service for VSCode?
  • 22. Language Server Protocol ﴾LSP﴿ Microsoft have developed a standard protocol for communications between editors and language services. Think of it as a WebAPI for Intellisense ﴾without the "web" bit﴿.
  • 23. OmniSharp OmniSharp is an out‐of‐process language server that brings C# to a large number of editors. It does not currently use LSP ﴾mainly because it existed long before LSP﴿ but there are definite similarities.
  • 24. Models for Intellisense Syntactic model Semantic model
  • 25. Syntactic model The syntactic model is essential for providing contextual Intellisense; it is used to map text ﴾i.e. editor﴿ positions to nodes in the AST. This allows you to at least work out what kind of syntactic element ﴾e.g. identifier﴿ is at the current position. In some cases, this is enough to work out what kinds of completions should be offered ﴾e.g. if you're inside an XML element's opening tag, then you can offer attributes﴿.
  • 26. Semantic model The semantic model builds on top of the syntactic model, adding information about what the syntactic element at the current position means ﴾e.g. identifier represents a variable, field, or property﴿. This allows you ﴾for example﴿ to work out, when on an XML element's opening tag, which attributes to offer completions for ﴾e.g. from schema﴿.
  • 27. Error tolerance ﴾robustness vs resilience﴿ To be useful for a language service, it's better for a compiler to err on the side of resilience rather than robustness; stopping on the first error without producing at least some kind of model makes it hard to provide Intellisense once the user starts typing ﴾since the source text is now probably invalid﴿. Instead, the compiler should produce an AST that can express invalid syntax ﴾even if it cannot then be fully processed to generate a semantic model﴿.
  • 28. Positioning Most language services have some form of the following 2 constructs: Position One‐dimensional; refers to a specific location in the text. Range ﴾sometimes called a Span﴿ Two‐dimensional; refers to all text between 2 positions.
  • 29. Positioning ﴾continued﴿ There are 2 commonly‐used models for positioning: Absolute ﴾usually 0‐based﴿ Measures the number of characters from the start of the document. Can be more efficient, but harder to reason about ﴾especially when you factor in different line‐endings﴿. Line / Column ﴾0‐based or 1‐based﴿ Easier to reason about. Can be less efficient, if you have to translate back‐and‐forth.
  • 30. Text position ‐> Model In order to provide contextual Intellisense, you need to be able to map the current position to something in your model. For this reason, it is important that your syntactic and / or semantic model captures positional information. Additionally, your syntactic model should make it easy to navigate between its elements ﴾sometimes the current element is not meaningful by itself and a broader scope needs to be taken into account﴿. For example, an XML syntax model should make it easy to move from an element to its parent, one of its children, or its next / previous sibling.
  • 31. Tips for language service developers ﴾1/4﴿ Avoid ad‐hoc parsing, especially at the string level. Build a syntactic / semantic model, and then build unit‐testable functionality around it. Ensure that your semantic model captures what you mean; ideally you should be able to use it to determine what kind of intellisense can be offered at a given position. Also, logging. Lots of logging.
  • 32. Tips for language service developers ﴾2/4﴿ Configurable all the things: Developers are picky, and don't like change; if you want to change the language service behaviour ﴾even when it's a definite improvement﴿, offer a setting to use the old behaviour. If a feature has even the slightest potential to be annoying, add a setting to turn it off. Tooltips on hover is a classic example of this. If you offer completions for standard entities, consider allowing the user to define their own entities to be offered alongside the built‐in completions.
  • 33. Tips for language service developers ﴾3/4﴿ Do what the user expects: Your language service should be predictable and transparent in its operation. Make it easy for the user to predict what your language service will do in a given context. Prefer to empower, rather than abstract. Offer to handle the gruntwork, but don't hide it. Otherwise, the user won't learn anything.
  • 34. Tips for language service developers ﴾4/4﴿ Don't try to be too clever ﴾nobody likes a smartarse﴿