GitHub has launched the code referencing feature on GitHub Copilot. The tool is presently in private beta testing and is aimed at providing developers with more control over the code it generates, Tech Crunch reported.
First previewed in November last year, the feature has taken a while to perfect and release. The code referencing attribute does not block any matching code it conjures up, instead displaying it in a sidebar for the developers’ discretion.
GitHub CEO, Thomas Dohmke, emphasizes that the original blocking feature, while effective, was comparatively a rough instrument. It did not allow developers the flexibility to decide whether to take the generated code and attribute it to an open-source license or find a library that could be used rather than generating new code.
“It prevents you from exploring these libraries and submitting pull requests. You might be reproducing everything that already exists in some open-source repo.” Dohmke remarked.
The CEO further mentioned that this especially applies to routine computer algorithms, such as sorting, which are frequently found in numerous locations. With this feature, developers have the liberty to either reject the code, use it directly, or task Copilot to revise the code, ensuring it bears no resemblance to the original code.
At present, the feature does not allow viewing results that comply with certain licenses only. However, the GitHub team is reaching out for feedback to discern if this is a requested feature.
“We’re letting people understand the match, and then go on to explore or make the correct decision,” said Dohmke, indicating how the feature fills the void that the original solution created.
This approach tends to be more active when Copilot lacks enough context to proceed. If the tool has a wide context from the current code being worked upon, it’s unlikely to suggest a matching public code. However, while starting afresh, the feature is more prone to generating matching codes. The matched code snippets are listed in the order discovered by the search engine.
The code-referring feature is also expected to arrive on Copilot Chat over time as part of GitHub’s continuous drive for innovation and convenience.
Via Tech Crunch