Improving code completion for Pharo

Marcus Denker
Marcus DenkerResearch Scientist at INRIA
IMPROVING
CODE COMPLETION
work by
Myroslava Romaniuk and Marcus Denker
What is Code Completion?
Problem
➥ on a Parser level
➥ on a Model level
➥ on a Sorter level
Problem: parser
Old completion used a dedicated parser
(Shout) that was originally shared with
syntax highlighter
Solution: use RB Parser
RBParser is used for syntax highlighting
We parse at every keystroke!
We can parse with Syntax Errors
Solution: parseSource
Solution: TypingVisitor
AST has not enough information
self, super, class of literals, Globals and
direct assignments to temps.
Solution: type check
Problem: model
Code is very hard to understand and change.
And the implementation behind the model
itself is unnecessarily complicated
Solution: model
➥ Type annotated AST
➥ CompletionProducer for suggesting
completion options based on node type
Solution: finding nodes
Solution: model results
➥ Using the AST simplifies the code a lot
➥ It is faster (no Benchmarks yet)
Problem: sorter
It was very difficult to implement a sorting
strategy as there was no separate
implementation of sorting
Solution: sorter
➥ you can choose the sorting strategy you
want in the settings (alphabetic by default)
➥ sorting strategies based on n-gram and
OCompletion will be added later
Refactoring results
# of classes 43 vs 22
# of methods 485 vs 243
# lines of code 3369 vs 1383
More improvements
➥ added completion for symbols
➥ fixed AST implementation
Fixing AST bugs
➥ incorrect stop in RBSequenceNode
➥ incorrect start in ParseErrorNode
➥ not recognising missing closing ‘|’ in
temp declaration as incorrect syntax
Future work
➥ ML based sorting strategy
➥ completing with syntax errors
➥ going beyond selector completion
Thanks!
@myroslavarm
@marcusdenker
romaniuk@ucu.edu.ua
marcus.denker@inria.fr
1 of 19

More Related Content

What's hot(12)

QTP10 _ 9.5 _ QTP10 _ 9.5 _
QTP10 _ 9.5 _
Sandeep Yadav455 views
TDD in the ABAP world - sitNL 2013 editionTDD in the ABAP world - sitNL 2013 edition
TDD in the ABAP world - sitNL 2013 edition
Hendrik Neumann2.1K views
Nguyenvandungb seminarNguyenvandungb seminar
Nguyenvandungb seminar
dunglinh1111.1K views
DebbugingDebbuging
Debbuging
Iama Marsian409 views
Bba105  computer fundamentals..Bba105  computer fundamentals..
Bba105 computer fundamentals..
smumbahelp84 views
Testing 101: Three Rules for Testing at Ombu Labs Testing 101: Three Rules for Testing at Ombu Labs
Testing 101: Three Rules for Testing at Ombu Labs
Ombu Labs, The Lean Software Boutique389 views
Top 5 matlab coursesTop 5 matlab courses
Top 5 matlab courses
Simpliv LLC44 views
Test Driven Development (TDD) BasicsTest Driven Development (TDD) Basics
Test Driven Development (TDD) Basics
Carlos Andrés Oquendo244 views
Complete ProgrammingComplete Programming
Complete Programming
lichtkind573 views
ProjectProject
Project
Max Friel5.9K views

Similar to Improving code completion for Pharo(20)

Study_of_Sequence_labeling_SystemsStudy_of_Sequence_labeling_Systems
Study_of_Sequence_labeling_Systems
Jayavardhan Reddy Peddamail86 views
5 hs mpostcustomizationrenefonseca5 hs mpostcustomizationrenefonseca
5 hs mpostcustomizationrenefonseca
ssuserfadb2455 views
Lecture: RefactoringLecture: Refactoring
Lecture: Refactoring
Marcus Denker821 views
Algorithm.pdfAlgorithm.pdf
Algorithm.pdf
MIT,Imphal75 views
Code smell overviewCode smell overview
Code smell overview
Pham Manh Lan1.9K views
RefactoringRefactoring
Refactoring
Xavier Fornés Arrabal301 views
RefactoringRefactoring
Refactoring
Arman Sheikh20 views
Algorithmic problem slovingAlgorithmic problem sloving
Algorithmic problem sloving
Mani Kandan268 views
5_RNN_LSTM.pdf5_RNN_LSTM.pdf
5_RNN_LSTM.pdf
FEG27 views
Compiler ConstructionCompiler Construction
Compiler Construction
Ahmed Raza1K views
C programming for Computing TechniquesC programming for Computing Techniques
C programming for Computing Techniques
Appili Vamsi Krishna906 views

More from Marcus Denker(20)

Soil And PharoSoil And Pharo
Soil And Pharo
Marcus Denker47 views
ConstantBlocks in Pharo11ConstantBlocks in Pharo11
ConstantBlocks in Pharo11
Marcus Denker50 views
Demo: Improved DoItDemo: Improved DoIt
Demo: Improved DoIt
Marcus Denker4 views
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
Marcus Denker413 views
Variables in PharoVariables in Pharo
Variables in Pharo
Marcus Denker84 views
Slot CompositionSlot Composition
Slot Composition
Marcus Denker295 views
Lecture: Advanced Reflection. MetaLinksLecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinks
Marcus Denker1.4K views
PHARO IOTPHARO IOT
PHARO IOT
Marcus Denker2.9K views
Open-Source: An Infinite GameOpen-Source: An Infinite Game
Open-Source: An Infinite Game
Marcus Denker1.2K views
Lecture: MetaLinksLecture: MetaLinks
Lecture: MetaLinks
Marcus Denker4.1K views
PharoTechTalk: Contributing to PharoPharoTechTalk: Contributing to Pharo
PharoTechTalk: Contributing to Pharo
Marcus Denker684 views
Feedback Loops in PracticeFeedback Loops in Practice
Feedback Loops in Practice
Marcus Denker860 views
Pharo6 - ESUG17Pharo6 - ESUG17
Pharo6 - ESUG17
Marcus Denker709 views
Pharo6Pharo6
Pharo6
Marcus Denker503 views
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
Marcus Denker1.2K views

Recently uploaded(20)

ThroughputThroughput
Throughput
Moisés Armani Ramírez25 views
METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
METHOD AND SYSTEM FOR PREDICTING OPTIMAL LOAD FOR WHICH THE YIELD IS MAXIMUM ...
Prity Khastgir IPR Strategic India Patent Attorney Amplify Innovation22 views
Green Leaf Consulting: Capabilities DeckGreen Leaf Consulting: Capabilities Deck
Green Leaf Consulting: Capabilities Deck
GreenLeafConsulting147 views
Liqid: Composable CXL PreviewLiqid: Composable CXL Preview
Liqid: Composable CXL Preview
CXL Forum114 views
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
Eleanor McHugh31 views

Improving code completion for Pharo