Skip to content

Commit

Permalink
(maint) - add adr for aggregating of file type
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbreen28 committed Nov 27, 2023
1 parent 807255a commit 5e0053c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/architecture/decisions/0001-aggregate-file-definitions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 1. Aggregation of file resource type definitions

Date: 2023-11-27

## Status

Accepted

## Context

During [this issue](https://github.com/puppetlabs/puppet-editor-services/issues/349), it was noted that the file resource type had multiple missing parameters in the dropdown autocompletion list. After some investigation, it was discovered that this way due to the way the file resource type is defined in the puppet source code, with having multiple definitions in different files. puppet-editor-services was only designed to collect the parameters in the file `lib/puppet/type/file.rb`, and collected all parameters from this file as you would expect, however it would ignore all other parameters which were defined in the files `lib/puppet/type/file/*.rb`. (see [here](https://github.com/puppetlabs/puppet/tree/main/lib/puppet/type/file)).

## Decision

A decision was taken in [this pr](https://github.com/puppetlabs/puppet-editor-services/pull/353) (later updated to write to a tempfile [here](https://github.com/puppetlabs/puppet-editor-services/pull/359)) to aggregate all seperate file type defintions and write these to a single file, this could then be used as a single point of reference for the language server. This allowed puppet-editor-services to collect all parameters of the file type as expected.

## Consequences

* `Go To Definition` will direct the user to the initial file type declaration at `/lib/puppet/type/file.rb`, not to the other type definitions.

0 comments on commit 5e0053c

Please sign in to comment.