Analysis of Real-Time Systems with Trace Compass
Total Page:16
File Type:pdf, Size:1020Kb
Clangd: LSP USING Clang Marc-André Laperle, Ericsson AGENDA/Topics 1 Introductions 2 Goals and scope of Clangd 3 Existing language server implementations 4 Challenges 5 Proposed architecture 6 Collaborations and planning © Ericsson AB 2016 | 2017-03-27 | Page 2 Introductions › Marc-André Laperle – Software Developer at Ericsson since 2013 – Eclipse committer for CDT (C/C++) and several other projects. – New LLVM/Clang contributor – Enthusiatic about C/C++, IDEs, and tooling in general (Not a compiler expert!) Your turn! © Ericsson AB 2016 | 2017-03-27 | Page 3 Goals and scope › Tool in Clang “Extras” › Implements the Language Server Protocol › Should it offer other services?? › Compiling and linking? © Ericsson AB 2016 | 2017-03-27 | Page 4 Existing Implementations › C/C++ for Visual Studio Code (Microsoft). Not open source. › C/C++ Clang Command Adapter (Yasuaki MITANI, Github). Parses Clang command output. › Others? © Ericsson AB 2016 | 2017-03-27 | Page 5 CHALLENGES › Refactoring and code generation › Speed? › Persisted database/index (Find references, Go to Definition, Call Hierarchy, etc) © Ericsson AB 2016 | 2017-03-27 | Page 6 Architecture › Should other clang-tools be invocked directly? Clang- format, clang-tify, clang-rename, etc. – Can they all be used as libraries? › © Ericsson AB 2016 | 2017-03-27 | Page 7 Planning › Persisted database › Use a JSon library (jsoncpp?) › Improvements to code completion › Open Declaration/Definition › Find references (functions, classes, fields, variables, with read/write information) › Call hierarchy. Callers and callees of a specific function or field. › Type hierarchy © Ericsson AB 2016 | 2017-03-27 | Page 8 Planning › Formatting (all done?) › Syntax/Semantic highlighting › Source hover › Code Lens › Signature Help › Code folding › Organize includes © Ericsson AB 2016 | 2017-03-27 | Page 9 Planning › Implement Method (Source generation) › Generate Getters and Setters (Source Generation) › Rename (Refactoring) › Extract Local Variable (Refactoring) › Extract Function (Refactoring) › Hide Method (Refactoring) › Quick Assits (local code transformations) © Ericsson AB 2016 | 2017-03-27 | Page 10 Placeholder/Notes © Ericsson AB 2016 | 2017-03-27 | Page 11.