16. ReSharper out of process
⢠Language server
⢠Headless. Command line process. IntelliJ provides the UIâ¨
Client/server communication
⢠Cross platformâ¨
.NET Framework on Windows. Mono on MacOS and Linux
⢠Removes Visual Studio in-process constraintsâ¨
Memory usage. 64 bit
⢠Continued investment in ReSharper
17. Thick Client? Thin Client?
⢠IntelliJ provides high level UI elements, functionality and infrastructureâ¨
Editors, Alt+Enter, completion, Find Usages, test runner, debuggingâŚâ¨
Searchable tree views, popup dialogs, settings pagesâŚ
⢠No knowledge of syntax trees or semantic modelâ¨
Parsing, resolving, syntax highlighting, folding, inspections, refactoring,
code completion, etc. all owned by ReSharper
⢠(Some standalone functionality)â¨
Find in path, REST client, Databases, VCS
⢠Optimisationsâ¨
Lexing for initial syntax highlighting
18.
19. Alt+Enter
⢠IntelliJ provides editor, text caret, and tracks Alt+Enter keypress
⢠Asks current language for items
⢠Current language is an IntelliJ facade for ReSharper out-of-procâ¨
Asks ReSharper for items at current location
⢠ReSharper returns list of display names, icons and submenus
⢠IntelliJ displays items in Alt+Enter menu
20. Inspection highlights
⢠IntelliJ provides infrastructure to display âsquiggliesâ
⢠Opposite direction, pushed from ReSharper
⢠Source ďŹle is opened, or modiďŹedâ¨
IntelliJ notiďŹes ReSharper
⢠ReSharper analyses the ďŹle, runs inspections, gathers highlights
⢠ReSharper publishes list of range, severity and tooltip
⢠IntelliJ displays squiggles
21. Modifying source
⢠Bi-directional
⢠User typingâ¨
IntelliJ publishes changes as delta of typed characters at oďŹset
⢠ReSharper rewriting codeâ¨
Publishes delta as chunk of codeâ¨
Renamed variable, new method, additional `using` statement, etc.
22. Observations
⢠Enabling functionality, rather than implementing itâ¨
Can show all Alt+Enter menus, run all inspections, rewrite code in
context actions and quick ďŹxes
⢠As long as there is no UIâŚ
⢠The data is very lightweight
23. IPC - RPC?
⢠Boilerplate - deďŹne calls and messages for each required action
⢠Imperative
⢠ConďŹict resolution?â¨
Who wins? How to reset/resync state?
⢠JSON? Protobuf?
Clientâ¨
(IntelliJ)
Serverâ¨
(ReSharper)
24. MVVM
⢠Only send data required for UI components
⢠Lightweight View Model data
Viewâ¨
(IntelliJ)
Modelâ¨
(ReSharper)
Viewâ¨
Model
26. Shared View Model
⢠Single view of state of entire IDEâ¨
Shared between front end and back endâ¨
Keep in sync. Only need to update changed ďŹelds
⢠Becomes declarativeâ¨
No more boilerplate messages, just update View Model
⢠Reactive/observable. Composableâ¨
Subscribe for changes
⢠Two wayâ¨
Client and server can both contribute to View Modelâ¨
E.g. button click/refactoring results
⢠Tightly coupled? đ¤
27. ConďŹict resolution
⢠The client is always right
⢠Each value has a version
⢠Version increments only when client changes value
⢠If server changes value, no version update
⢠Only accept change with same or newer version
29. Wire protocol
⢠Becomes trivial - no messages, just deltasâ¨
Donât change the protocol, just extend model
⢠Supports batching
⢠Serialisation by code generation via DSL
⢠Binary wire protocol, with logging
⢠Sockets
30. Rider Framework
⢠Two libraries, C# and Kotlinâ¨
Provides primitives and handles communication
⢠Kotlin based DSL to describe View Model
⢠Generates real code - C# and Kotlinâ¨
Interfaces, implementation and serialisation
⢠Business logic subscribes to and manipulates âreal modelââ¨
Magic happens
39. Challenges
⢠Riderâs Project Model very diďŹerent to IntelliJâ¨
Replace Project view with Solution Explorerâ¨
IntelliJ uses âprojectâ where we expect âsolutionâ
⢠What about duplicate language implementations?â¨
E.g. JavaScript - WebStorm or ReSharper?â¨
C++ CLion or ReSharper?
⢠Plugins are more complexâ¨
Front end and back end
⢠ReSharper out of process with Visual Studio? đ