From the course: AI-Powered Development: GitHub Copilot in Visual Studio Code
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Get refactoring suggestions
From the course: AI-Powered Development: GitHub Copilot in Visual Studio Code
Get refactoring suggestions
We know we should refactor our code. That's one of the core ideas in test driven development. Once the tests are in place, we can safely improve the structure of the code as needed. So let's see if Copilot can spot any refactoring opportunities for us. Here's my query. Do you have any suggestions for refactoring the code. Again the context is this HTML file. I don't know if you saw it when it was running but it says I'm reanalyzing the code. Now that's because I have a running set of queries happening here and it's remembering what I've asked in the past. So it is revisiting refactoring ideas. The answer that it's giving me is Of course, the code is quite good for self-contained utility, but here are several suggestions for refactoring that would improve its structure, its maintainability, and security. Number one, separate concerns. We should put the HTML, the CSS, and JavaScript in separate files. So it says we should create a style CSS main.js and move all the code into the JS file…
Contents
-
-
-
-
-
-
(Locked)
Use chat to ask code specific questions2m 48s
-
(Locked)
Use chat to explore a project4m 18s
-
(Locked)
Explore the Word Frequency Analyzer page1m 30s
-
(Locked)
Explain a section of code5m 53s
-
(Locked)
Guidance on potential issues2m 26s
-
(Locked)
Get refactoring suggestions2m 57s
-
(Locked)
Have Copilot draft an editing prompt3m 8s
-
(Locked)
Review the hidden reasoning workflow2m 34s
-
(Locked)
Inline chat: Exploring the code editor2m 34s
-
(Locked)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-