GithubHelp home page GithubHelp logo

dev-cycles / contextive Goto Github PK

View Code? Open in Web Editor NEW
162.0 4.0 3.0 6.44 MB

Get on the same page.

Home Page: https://contextive.tech

License: MIT License

Dockerfile 0.98% Shell 1.28% F# 90.49% JavaScript 3.62% C# 0.18% Ruby 0.04% Kotlin 3.41%
ddd ubiquitous-language knowledge-management domain-modelling

contextive's People

Contributors

chrissimon-au avatar erikjuhani avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

contextive's Issues

Support sharing definitions between repos with different languages/package managers

Background

#36 introduced support for sharing definitions between repositories, but it relies on leveraging an existing sharing mechanism between those repositories - package distribution (e.g. go get, npm, nuget, etc.).

There are also use cases where there are no existing packages shared between repositories, and yet they both relate to the same bounded context. A typical example is a split between a front-end (e.g. in JavaScript/TypeScript) and a backend (e.g. in go, NodeJs, Ruby, .NET, JVM, etc.).

There is a case to be made that splitting such repos is an antipattern from the perspective of keeping all code associated with a bounded context in a more cohesive manner (e.g. a single repo), since functional changes are likely to affect all code that is a manifestation of that bounded context. However, current CI/CD tooling is far more attuned to aligning repositories with deployable components rather than logical components, so for the time being, this is definitely a scenario that Contextive needs to handle.

Options:

Considered approaches for sharing with pros & cons:

Raw URL from hosted source control

Common hosted source control platforms (e.g. github, bitbucket, gitlab) offer a raw URL to retrieve a file from a repo.

  • Pros:
    • Simple mechanism to retrieve the file
  • Cons:
    • Have to poll the URL to retrieve updates
    • Have to authenticate the URL, which likely means storing auth credentials (added security burden) or prompting for credentials (user friction)
    • Only works if the repo has such a RAW url

Clone repo into tmp folder

Could clone a nominated repo into it's own tmp folder and identify the file in that repo

  • Pros:
    • Able to retrieve the file, even if no RAW url available
  • Cons:
    • Have to poll the repo (fetch/update) to retrieve updates
    • Have to authenticate to clone. Might work seamlessly if the user has stored credentials (e.g. ssh key), but would be painful if not
    • Have to clone the whole repo - no way to get a single file (e.g. github explicitly blocks the git archive mechanism)

Self-published/hosted

Much like how many teams publish a swagger/json file alongside their API, a contextive definitions file could be included in a build process as an artifact, and thus made available at a URL in a preproduction (or even production) environment

  • Pros:
    • Potential to access the file at a simple URL with no authentication
  • Cons:
    • More effort for teams to publish the definitions file
    • Teams may not like the file being publicly available (may have auth, vpn, or source IP restrictions)

Contextive reports warning in IntelliJ 'cannot load definitions file' when opening a project without a definitions file

Describe the bug
Contextive warning popup

Expected behavior
No error when opening a project without a definitions file.

Additional context
In VsCode this is avoided because the extension is only activated on the presence of the definitions file. With IntelliJ, the plugin is activated all the time, but still expects the definitions file to exist.

Options to resolve:

  • Don't activate extension unless project folder contains a definitions file (perhaps hooking into ProjectActivity, or check for definitions file present in fileOpened)
  • Don't flag warning when definitions file not found

Support sharing definitions from multiple sources into the current work environment

Background

#37 was created to support the scenario where a single bounded context is split into multiple repositories. We don't want to copy the term definitions associated with the context into all the repositories, so it is looking for a way to define them in one source repo and distribute/share them out to working environments when working in other repositories.

Feature Idea

This ticket builds on that idea by supporting the notion of sharing from multiple sources. e.g. a repository for an 'app' that includes code associated with terminology from multiple bounded contexts, where the context definitions have been split up and are in other locations as per #37.

While this repository layout pattern is not recommended, it is a reality that some teams will be in that situation and we'd still like to help them get access to clearer definitions of the domain concepts they're working with.

This feature could also be useful in a repo per context configuration if you would like to have visibility of the usage of the same terminology in other contexts as a way of aiding clarity on the distinction between the usage in each context.

Contextive LSP fails with unhandled exception

Describe the bug
First time opening Contextive LSP with Helix editor causes Contextive LSP to throw an unhandled exception. The unhandled exception is Method not found: window/showMessageRequest which seems to be coming from the survey code.

To Reproduce

  1. Install helix https://helix-editor.com/
  2. Install Contextive 1.10.3
  3. Configure helix with contextive for typescript by adding ~/.config/helix/languages.toml config with
[[language]]
name = "typescript"
language-servers = [{ name = "contextive" }]

[language-server.contextive]
args = [ "--stdio"]
command = "Contextive.LanguageServer"
  1. Add example contextive config to your repo root: .contextive/definitions.yml from https://github.com/dev-cycles/contextive-demo-go-common/blob/main/.contextive/definitions.yml
  2. Hover "Sample" anywhere in your repo by pressing <space>+k when cursor is on top of the word "Sample"

Expected behavior
Contextive should give tooltip about the term

Helix log of the error

2023-11-17T17:44:49.725 helix_term::application [ERROR] Language Server: Method window/showMessageRequest not found in request 1
2023-11-17T17:44:49.767 helix_lsp::transport [ERROR] contextive err <- "Unhandled exception. System.AggregateException: One or more errors occurred. (Method not found: 'window/showMessageRequest'.)\n"
2023-11-17T17:44:49.767 helix_lsp::transport [ERROR] contextive err <- " ---> OmniSharp.Extensions.JsonRpc.Server.MethodNotSupportedException: Method not found: 'window/showMessageRequest'.\n"
2023-11-17T17:44:49.767 helix_lsp::transport [ERROR] contextive err <- "   at OmniSharp.Extensions.JsonRpc.ResponseRouter.ResponseRouterReturnsImpl.Returning[TResponse](CancellationToken cancellationToken)\n"
2023-11-17T17:44:49.767 helix_lsp::transport [ERROR] contextive err <- "   at [email protected]() in /Users/runner/work/contextive/contextive/src/language-server/Contextive.LanguageServer/Survey.fs:line 31\n"
2023-11-17T17:44:49.767 helix_lsp::transport [ERROR] contextive err <- "   at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.Initialize(CancellationToken token)\n"
2023-11-17T17:44:49.767 helix_lsp::transport [ERROR] contextive err <- "   at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.From(LanguageServerOptions options, IServiceProvider outerServiceProvider, CancellationToken cancellationToken)\n"
2023-11-17T17:44:49.767 helix_lsp::transport [ERROR] contextive err <- "   --- End of inner exception stack trace ---\n"
2023-11-17T17:44:49.767 helix_lsp::transport [ERROR] contextive err <- "   at Microsoft.FSharp.Control.AsyncResult`1.Commit() in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\async.fs:line 454\n"
2023-11-17T17:44:49.767 helix_lsp::transport [ERROR] contextive err <- "   at Microsoft.FSharp.Control.AsyncPrimitives.QueueAsyncAndWaitForResultSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\async.fs:line 1137\n"
2023-11-17T17:44:49.767 helix_lsp::transport [ERROR] contextive err <- "   at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\async.fs:line 1167\n"
2023-11-17T17:44:49.767 helix_lsp::transport [ERROR] contextive err <- "   at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\async.fs:line 1509\n"
2023-11-17T17:44:49.767 helix_lsp::transport [ERROR] contextive err <- "   at Contextive.LanguageServer.Program.main(String[] argv) in /Users/runner/work/contextive/contextive/src/language-server/Contextive.LanguageServer/Program.fs:line 36\n"
2023-11-17T17:44:49.768 helix_lsp::transport [ERROR] contextive err: <- StreamClosed
2023-11-17T17:44:50.361 helix_term::application [ERROR] received malformed notification from Language Server: Unhandled

Desktop:

  • OS: MacOS Sonoma 14.1
  • Editor: Helix 23.10
  • .NET SDKs installed 6.0.417, 8.0.100
  • Contextive 1.10.3

Support multiple definition files in a single repository

It should be possible to 'split' a definitions file into multiple files even in a single repo (monorepo) configuration, so that teams that 'own' a context and also 'own' a folder structure within the monorepo can keep their definitions local to their context code and own the file containing their definitions.

Some initial ideas for how to implement this:

  • Add an 'import' mechanism to the central definitions file. Other files can be located wherever and can be 'imported' via a relative path into the overall definitions structure
  • Update the contextive.path setting to be a contextive.paths setting which lists a set of files to be loaded by contextive
  • A more convention oriented approach where the whole folder structure is scanned for a well defined filename (e.g. definitions.yml or contextive.yml so it would just be a matter of creating a file anywhere with the correct filename and it would get picked up

Related Tickets

This is related to #39, however that ticket is more focussed on supporting the multi-root workspace in VSCode, which carries with it extra considerations around handling scoped settings and resources. However, the facility to at least handle definitions coming from multiple files will likely support the implementation of #39.

Language Server process doesn't exit when LanguageClient or vscode stops.

Might be related to microsoft/vscode-languageserver-node#850 which is resolved, but we are blocked upgrading to the v8 series of the language client by the fable bindings. Propose to prepare an updated fable binding for https://github.com/ionide/ionide-vscode-helpers or at very least store the updated bindings directly in the contextive repo.

To ease the impact on development (which was blocking builds due to old processes locking the binaries), runTests has a temporary workaround to kill all "dotnet run" processes after a test run. This workaround can be removed once the bug is resolved.

Multiple context definition files

When I am in Vs code and split my big context file into multiple files, and delete default definition yml (one context each), everything keeps working. And the tool tips are based on the contents of all the definition files.

When you restart Vs code it complains that definitions file can not be found.

Neovim setup not working

Hey!

found this plugin from Bran van der Meer latest video on ubiquitous languages.

I was able to get the plugin working using Visual Studio Code pretty much immediately.

However, I could not get the neovim set up working.

Describe the bug
When typing a word such as "definition/alias" I expect an autocomplete to popup with the definition, instead I am getting nothing.

To Reproduce
I have installed the LSP server using the osx arm build for an M1 Mac. It is located in /usr/local/bin and can be executed (had to accept the run anyway in the Apple security settings).

I am able to run the following lua commands listed in the README.md file without any errors using :lua [command].

require("lspconfig.configs").contextive = { default_config = { cmd = { "Contextive.LanguageServer" }, root_dir = require("lspconfig").util.root_pattern('.contextive', '.git'), } }
require("lspconfig").contextive.setup{}

I tried this since my configuration in lsp.luawithin my Neovim nvim repository wasn't loading it either. Note I am using LazyVim
plugins/lsp.lua

return {
  {
    "VonHeikemen/lsp-zero.nvim",
    branch = "v2.x",
    dependencies = {

      {
        "williamboman/mason.nvim",
        opts = {
          ui = { border = "rounded" },
        },
      },
      { "williamboman/mason-lspconfig.nvim" },

      --cmp
      { "hrsh7th/nvim-cmp" },
      { "hrsh7th/cmp-buffer" },
      { "hrsh7th/cmp-path" },
      { "saadparwaiz1/cmp_luasnip" },
      { "hrsh7th/cmp-nvim-lsp" },
      { "hrsh7th/cmp-nvim-lua" },

      --snip
      { "L3MON4D3/LuaSnip" },
      { "rafamadriz/friendly-snippets" },
    },
    config = function()
      local lsp = require("lsp-zero")

      lsp.preset("recommended")

      lsp.ensure_installed({
        "tsserver",
        "lua_ls",
        "eslint",
      })

      -- Fix Undefined global 'vim'
      lsp.configure("lua_ls", {
        settings = {
          Lua = {
            diagnostics = {
              globals = { "vim" },
            },
          },
        },
      })

      local cmp = require("cmp")
      local cmp_select = { behavior = cmp.SelectBehavior.Select }
      local cmp_mappings = lsp.defaults.cmp_mappings({
        ["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
        ["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
        ["<C-b>"] = cmp.mapping.scroll_docs(-4),
        ["<C-f>"] = cmp.mapping.scroll_docs(4),
        ["<C-Space>"] = cmp.mapping.complete(),
        ["<C-e>"] = cmp.mapping.abort(),
        ["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
        ["<S-CR>"] = cmp.mapping.confirm({
          behavior = cmp.ConfirmBehavior.Replace,
          select = true,
        }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
      })

      lsp.setup_nvim_cmp({
        preselect = cmp.PreselectMode.None,
        mapping = cmp_mappings,
      })

      lsp.set_preferences({
        suggest_lsp_servers = false,
      })

      lsp.setup()

      vim.diagnostic.config({
        virtual_text = false,
      })
    end,
  },
  {
    "hrsh7th/nvim-cmp",
    dependencies = { "hrsh7th/cmp-emoji" },
    ---@param opts cmp.ConfigSchema
    opts = function(_, opts)
      local cmp = require("cmp")
      opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } }))
    end,
  },
  --lsp support
  {
    "neovim/nvim-lspconfig",
    dependencies = { "jose-elias-alvarez/typescript.nvim" },
    config = function()
      local lspconfig = require("lspconfig")

      local lspconfig_configs = require("lspconfig.configs")

      lspconfig_configs.contextive = {
        default_config = {
          cmd = { "Contextive.LanguageServer" },
          root_dir = lspconfig.util.root_pattern(".contextive", ".git"),
        },
      }

      lspconfig.contextive.setup({})
    end,
    opts = {
      autoformat = false,
      servers = {
        tsserver = {
          settings = {
            typescript = {
              inlayHints = {
                -- taken from https://github.com/typescript-language-server/typescript-language-server#workspacedidchangeconfiguration
                includeInlayEnumMemberValueHints = true,
                includeInlayFunctionLikeReturnTypeHints = true,
                includeInlayFunctionParameterTypeHints = true,
                includeInlayParameterNameHints = "all",
                includeInlayParameterNameHintsWhenArgumentMatchesName = true, -- false
                includeInlayPropertyDeclarationTypeHints = true,
                includeInlayVariableTypeHints = true,
                includeInlayVariableTypeHintsWhenTypeMatchesName = true, -- false
              },
            },
            javascript = {
              inlayHints = {
                includeInlayEnumMemberValueHints = true,
                includeInlayFunctionLikeReturnTypeHints = true,
                includeInlayFunctionParameterTypeHints = true,
                includeInlayParameterNameHints = "all",
                includeInlayParameterNameHintsWhenArgumentMatchesName = true,
                includeInlayPropertyDeclarationTypeHints = true,
                includeInlayVariableTypeHints = true,
                includeInlayVariableTypeHintsWhenTypeMatchesName = true,
              },
            },
          },
        },
      },
    },
  },
}

Expected behavior
I believe I should see the definition popup when adding the word inside the IDE
photo-11-10 at 12 58 06@2x
photo-11-10 at 12 58 24@2x

I would also assume I would be able to see Contextive being attached to the buffer when using :LspInfo

45856

Desktop (please complete the following information):

  • OS: OSX Sonoma 14.1
  • Neovim: v0.9.4

Additional context
Would be easier if this could be installed directly using lspzero

Multi-line yaml can result in additional underscores

Step to reproduce:

In the definition yaml use > to signify multi-line text.

contexts:
  - name: eCommerce
    domainVisionStatement: >
      Allowing customers to discover and purchase products and services online
      I like line breaks, so text is easy to read when reviewing pull requests on the
      train or bus when I am travelling.

Current result/situation:

The text that is rendered is wrapped with the underscore character _.
The title (vision) is within this wrap.

image

Expected result:

The text should not be prefixed, and should be italized.

Work around

Add the strip block chomping operator.
This causes everything is display correctly.

e.g. >-

image

contexts:
  - name: eCommerce
    domainVisionStatement: >-
      Allowing customers to discover and purchase products and services online
      I like line breaks, so text is easy to read when reviewing pull requests on the
      train or bus when I am traveling.

Support VSCode multi-root

Think about having a monorepo and a multi root workspace where every package/app has a root also and maybe the monorepo as well.

Exception starting 1.10.4 due to dotnet trimming

Describe the bug

Unhandled exception. System.AggregateException: One or more errors occurred. (The type initializer for 'DryIoc.Registrator' threw an exception.)
 ---> System.TypeInitializationException: The type initializer for 'DryIoc.Registrator' threw an exception.
 ---> DryIoc.ContainerException: code: Error.UndefinedMethodWhenGettingTheSingleMethod;
message: Undefined Method '"Initializer"' in Type DryIoc.Registrator (including non-public=True)
   at DryIoc.Throw.ThrowIfNull[T](T, Int32 , Object , Object , Object , Object )
   at DryIoc.ReflectionTools.SingleMethod(Type, String, Boolean )
   at DryIoc.Registrator..cctor()
   --- End of inner exception stack trace ---
   at OmniSharp.Extensions.JsonRpc.JsonRpcServerServiceCollectionExtensions.AddJsonRpcMediatR(IContainer)
   at OmniSharp.Extensions.JsonRpc.JsonRpcServerServiceCollectionExtensions.AddJsonRpcServerCore[T](IContainer, JsonRpcServerOptionsBase`1)
   at OmniSharp.Extensions.LanguageServer.Shared.LanguageProtocolServiceCollectionExtensions.AddLanguageProtocolInternals[T](IContainer, LanguageProtocolRpcOptionsBase`1)
   at OmniSharp.Extensions.LanguageServer.Server.LanguageServerServiceCollectionExtensions.AddLanguageServerInternals(IContainer, LanguageServerOptions, IServiceProvider )
   at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.From(LanguageServerOptions, IServiceProvider , CancellationToken)
   --- End of inner exception stack trace ---
   at Microsoft.FSharp.Control.AsyncResult`1.Commit() in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 454
   at Microsoft.FSharp.Control.AsyncPrimitives.QueueAsyncAndWaitForResultSynchronously[a](CancellationToken, FSharpAsync`1, FSharpOption`1) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1140
   at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1, FSharpOption`1 , FSharpOption`1 ) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1511
   at Contextive.LanguageServer.Program.main(String[]) in /home/runner/work/contextive/contextive/src/language-server/Contextive.LanguageServer/Program.fs:line 36

To Reproduce
Start contextive v1.10.4

Expected behavior
It should start normally.

Desktop (please complete the following information):
All

Additional context
From local testing, is caused by the use of https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-self-contained

Support multi-root workspaces in vscode with different definitions files in each root

Related to #38, but on that one it was decided to just support a single shared definitions file.

To support separate definitions files, a few changes are needed:

  1. LanguageServer needs to request configuration with a resource scope for the file currently being worked on (auto-complete or hover)
  2. LanguageClient middleware added for #38 needs to detect the resource scope and skip the path rewriting. VsCode default configuration should supply the config value for the appropriate workspace based on the resource scope
  3. LanguageServer needs to maintain a definitions file state for all possible definitions files and to use the correct one depending on the file being worked on

Omnisharp error after installing Contextive

Just installed Contextive from the marketplace in VS code 1.80.0 on Windows

Then ran the Contextive: Initialize Definitions

And now I get errors all the time, even hovering over stuff in the output window with

"Request textDocument/hover failed.
Source: Contextive (Extension) Go to output

From Output
[Error - 7:30:59 AM] Request textDocument/hover failed. Message: Internal Error - System.TimeoutException: MailboxProcessor.PostAndAsyncReply timed out. at <StartupCode$FSharp-Core>[email protected](FSharpOption1 res) in D:\a_work\1\s\src\FSharp.Core\mailbox.fs:line 472
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation1 ctxt, b result1, FSharpFunc2 userCode) in D:\a_work\1\s\src\FSharp.Core\async.fs:line 528
at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc2 firstAction) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 148 --- End of stack trace from previous location --- at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPreProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPostProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionActionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestExceptionActionProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at OmniSharp.Extensions.JsonRpc.RequestRouterBase1.g__InnerRoute|7_0(IServiceScopeFactory serviceScopeFactory, Request request, TDescriptor descriptor, Object params, CancellationToken token, ILogger logger)
at OmniSharp.Extensions.JsonRpc.RequestRouterBase1.RouteRequest(IRequestDescriptor1 descriptors, Request request, CancellationToken token)
at OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker.<>c__DisplayClass10_0.<b__5>d.MoveNext()
Code: -32603
`

Add a `LICENSE` file

I noticed that there's no LICENSE file specified, even though there is a mention of the MIT license in the root README. This might be confusing for someone who is trying to determine the project's licensing, potentially leading to misinterpretations.

According to GitHub's documentation on licenses, it's considered best practice to include a license file with the project.

As a best practice, we encourage you to include the license file with your project.
https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository#choosing-the-right-license

Should a LICENSE file be added into this project?

Support for shared definitions

We use multiple git repositories for distinct services / functions in the same domain. Do you have any ideas for how we could share the definitions.yml file between them (other than copy and paste ๐Ÿ˜œ)?

Editor agnostic configuration

Is your feature request related to a problem? Please describe.
Currently, Contextive heavily relies on the .vscode folder to exist in order to manage the path location for Contextive definitions files. However, this approach does not work well, if at all, with other editors.

Describe the solution you'd like
I think to solve this, one must approach this problem in an agnostic way. One option could be to have a separate contextive.json file stored in the repository root. This file would contain the behavior-altering configurations, such as where to look for the definitions path for the Contextive language server. Instead of setting up language server client settings, the Contextive configuration would be handled separately.

Additional context
It may not be feasible to configure this within the language server client options, considering that many people use editors that don't rely on the .vscode directory. Moreover, it becomes impractical when working across multiple repositories with different path locations. In practical terms, this would require me to adjust my editor configuration every time I switch to a repository with a distinct Contextive path location.

Context menu not showing in .cs files with Rider

Describe the bug
A clear and concise description of what the bug is.

When typing a word, defined in the definitions yaml file, it shows the context name, but no definition, nor a pop-up with details. It works in the definition yaml file itselt, just not in the .cs files.

To Reproduce

  1. Open or create a new project in Rider, add the contextive definition file as described in the 'Getting Started' part.
  2. Open the 'definitions.yml' and hover over any of the definitions, you will see a popup showing the definition.
  3. Create a new .cs file, a class, and type a word from the definition file (e.g.: context). Only the context name will show, no popup or definition will show:

contextive-1

Expected behavior
Showing the definition of the word, or showing a popup.

Screenshots

Not working in a c-sharp file:
contextive-2

Working in the definition file:
contextive-3

Desktop (please complete the following information):

  • OS: Arch Linux ( + i3wm)
  • IDE: JetBrains Rider 2023.3.3

Additional context
Some extra logfiles:

idea.txt
contextive-filter-log.txt
contextive-rider-log.txt

IntelliJ doesn't show completion list in certain positions

Describe the bug
Due to IntelliJ's rules for determining a completionlist prefix, sometimes it doesn't show the Contextive complteion list as it determines the prefix doesn't match. e.g. in a yml file like:

key: value s

If the cursor is after the s, then Contextive would return a list and expect it to be filtered by the prefix s but intellij would attempt to filter with the value value s as it considers everything after the : to be prefix.

Expected behavior
It should show the completion list even at the position s

Additional context

From discussion with JetBrains support, they recommend using the textEdit field, not the insertText field in the completion item, as this is more explicit and would avoid client-side interpretation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.