{"id":17178527,"url":"https://github.com/bobbylight/autocomplete","last_synced_at":"2026-01-03T05:19:24.590Z","repository":{"id":9948816,"uuid":"11967527","full_name":"bobbylight/AutoComplete","owner":"bobbylight","description":"A code completion library for Swing text components, with special support for RSyntaxTextArea.","archived":false,"fork":false,"pushed_at":"2025-02-17T20:06:03.000Z","size":1068,"stargazers_count":173,"open_issues_count":37,"forks_count":58,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-23T05:12:13.990Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bobbylight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-08-08T04:26:18.000Z","updated_at":"2025-05-05T15:19:04.000Z","dependencies_parsed_at":"2024-12-29T05:04:08.685Z","dependency_job_id":"be6088fd-3f08-453b-86fb-364cd90579da","html_url":"https://github.com/bobbylight/AutoComplete","commit_stats":{"total_commits":257,"total_committers":6,"mean_commits":"42.833333333333336","dds":"0.42801556420233466","last_synced_commit":"66112d2ce48a3e067e188c8a6a4b53a1ad61c6e1"},"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/bobbylight/AutoComplete","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobbylight%2FAutoComplete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobbylight%2FAutoComplete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobbylight%2FAutoComplete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobbylight%2FAutoComplete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bobbylight","download_url":"https://codeload.github.com/bobbylight/AutoComplete/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobbylight%2FAutoComplete/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280965550,"owners_count":26421660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T00:07:36.437Z","updated_at":"2025-10-25T14:14:05.214Z","avatar_url":"https://github.com/bobbylight.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AutoComplete\r\n![Java Build](https://github.com/bobbylight/AutoComplete/actions/workflows/gradle.yml/badge.svg)\r\n![Java Build](https://github.com/bobbylight/AutoComplete/actions/workflows/codeql-analysis.yml/badge.svg)\r\n![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.fifesoft/autocomplete/badge.svg)\r\n\r\nAutoComplete is a code completion library for Swing JTextComponents, with enhanced functionality available\r\nfor instances of [RSyntaxTextArea](https://github.com/bobbylight/RSyntaxTextArea).\r\n\r\nAutoComplete is available under a [modified BSD license](https://github.com/bobbylight/AutoComplete/blob/master/LICENSE.md).\r\n\r\n# Features\r\n* A completion choices list that updates as the user types\r\n* A \"documentation\" companion window for displaying documentation about the currently selected completion choice\r\n* Parameter assistance (e.g. tabbing through function/method parameters, with tool tip assistance for each argument\r\n  and a possible list of valid variable completions for each)\r\n\r\n# Adding to Your Project\r\nThis library is available in the\r\n[Maven Central repository](http://search.maven.org/#search%7Cga%7C1%7Cautocomplete%20jar) (`com.fifesoft:autocomplete:XXX`).\r\nSNAPSHOT builds of the in-development, unreleased version are hosted on\r\n[Sonatype](https://oss.sonatype.org/content/repositories/snapshots/com/fifesoft/autocomplete/).\r\n\r\n# Compiling\r\nAutoComplete is built using Gradle. It requires Java 17 to buil but runs on\r\nJava 8 or later.\r\nTo compile the source, run all tests, and build the distribution jar,\r\nsimply run the following gradle command:\r\n\r\n```bash\r\ngradlew clean build --warning-mode all\r\n```\r\n\r\n# Example Usage\r\nThe example below shows how to add code completion for simple keywords to\r\nRSyntaxTextArea.  For more examples, see the `AutoCompleteDemo`\r\nsubmodule in this project.\r\n\r\n```java\r\nimport java.awt.*;\r\nimport javax.swing.*;\r\nimport org.fife.ui.autocomplete.*;\r\nimport org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;\r\nimport org.fife.ui.rsyntaxtextarea.SyntaxConstants;\r\nimport org.fife.ui.rtextarea.RTextScrollPane;\r\n\r\npublic class AutoCompleteDemo extends JFrame {\r\n\r\n   public AutoCompleteDemo() {\r\n\r\n      JPanel contentPane = new JPanel(new BorderLayout());\r\n      RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60);\r\n      textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);\r\n      textArea.setCodeFoldingEnabled(true);\r\n      contentPane.add(new RTextScrollPane(textArea));\r\n\r\n      // A CompletionProvider is what knows of all possible completions, and\r\n      // analyzes the contents of the text area at the caret position to\r\n      // determine what completion choices should be presented. Most instances\r\n      // of CompletionProvider (such as DefaultCompletionProvider) are designed\r\n      // so that they can be shared among multiple text components.\r\n      CompletionProvider provider = createCompletionProvider();\r\n\r\n      // An AutoCompletion acts as a \"middle-man\" between a text component\r\n      // and a CompletionProvider. It manages any options associated with\r\n      // the auto-completion (the popup trigger key, whether to display a\r\n      // documentation window along with completion choices, etc.). Unlike\r\n      // CompletionProviders, instances of AutoCompletion cannot be shared\r\n      // among multiple text components.\r\n      AutoCompletion ac = new AutoCompletion(provider);\r\n      ac.install(textArea);\r\n\r\n      setContentPane(contentPane);\r\n      setTitle(\"AutoComplete Demo\");\r\n      setDefaultCloseOperation(EXIT_ON_CLOSE);\r\n      pack();\r\n      setLocationRelativeTo(null);\r\n\r\n   }\r\n\r\n   /**\r\n    * Create a simple provider that adds some Java-related completions.\r\n    */\r\n   private CompletionProvider createCompletionProvider() {\r\n\r\n      // A DefaultCompletionProvider is the simplest concrete implementation\r\n      // of CompletionProvider. This provider has no understanding of\r\n      // language semantics. It simply checks the text entered up to the\r\n      // caret position for a match against known completions. This is all\r\n      // that is needed in the majority of cases.\r\n      DefaultCompletionProvider provider = new DefaultCompletionProvider();\r\n\r\n      // Add completions for all Java keywords. A BasicCompletion is just\r\n      // a straightforward word completion.\r\n      provider.addCompletion(new BasicCompletion(provider, \"abstract\"));\r\n      provider.addCompletion(new BasicCompletion(provider, \"assert\"));\r\n      provider.addCompletion(new BasicCompletion(provider, \"break\"));\r\n      provider.addCompletion(new BasicCompletion(provider, \"case\"));\r\n      // ... etc ...\r\n      provider.addCompletion(new BasicCompletion(provider, \"transient\"));\r\n      provider.addCompletion(new BasicCompletion(provider, \"try\"));\r\n      provider.addCompletion(new BasicCompletion(provider, \"void\"));\r\n      provider.addCompletion(new BasicCompletion(provider, \"volatile\"));\r\n      provider.addCompletion(new BasicCompletion(provider, \"while\"));\r\n\r\n      // Add a couple of \"shorthand\" completions. These completions don't\r\n      // require the input text to be the same thing as the replacement text.\r\n      provider.addCompletion(new ShorthandCompletion(provider, \"sysout\",\r\n            \"System.out.println(\", \"System.out.println(\"));\r\n      provider.addCompletion(new ShorthandCompletion(provider, \"syserr\",\r\n            \"System.err.println(\", \"System.err.println(\"));\r\n\r\n      return provider;\r\n\r\n   }\r\n\r\n   public static void main(String[] args) {\r\n      // Instantiate GUI on the EDT.\r\n      SwingUtilities.invokeLater(() -\u003e {\r\n        try {\r\n           String laf = UIManager.getSystemLookAndFeelClassName();\r\n           UIManager.setLookAndFeel(laf);\r\n        } catch (Exception e) { /* Never happens */ }\r\n        new AutoCompleteDemo().setVisible(true);\r\n      });\r\n   }\r\n\r\n}\r\n```\r\n# Sister Projects\r\n* [RSyntaxTextArea](https://github.com/bobbylight/RSyntaxTextArea) provides syntax highlighting, code folding, and many other features out-of-the-box.\r\n* [RSTALanguageSupport](https://github.com/bobbylight/RSTALanguageSupport) - Code completion for RSTA for the following languages: Java, JavaScript, HTML, PHP, JSP, Perl, C, Unix Shell.  Built on both RSTA and AutoComplete.\r\n* [SpellChecker](https://github.com/bobbylight/SpellChecker) - Adds squiggle-underline spell checking to RSyntaxTextArea.\r\n* [RSTAUI](https://github.com/bobbylight/RSTAUI) - Common dialogs needed by text editing applications: Find, Replace, Go to Line, File Properties.\r\n\r\n# Getting Help\r\n* Add an [issue on GitHub](https://github.com/bobbylight/AutoComplete/issues)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobbylight%2Fautocomplete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbobbylight%2Fautocomplete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobbylight%2Fautocomplete/lists"}