Skip to content

Commit 88238e1

Browse files
author
jordanbreen28
committed
(maint) - add adr for aggregating of file type
1 parent 807255a commit 88238e1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# 1. Aggregation of file resource type definitions
2+
3+
Date: 2023-11-27
4+
5+
## Status
6+
7+
Accepted
8+
9+
## Context
10+
11+
In [this issue](https://github.com/puppetlabs/puppet-editor-services/issues/349) raised on the `puppet-editor-services` repo, it was noted that the file resource type had multiple missing parameters in the dropdown autocompletion list. After some investigation, it was discovered that the parameters were missing due to the way the file resource type is defined in the puppet source code, with having multiple definitions in separate files. puppet-editor-services was only designed to collect the parameters in the initial definition found in `lib/puppet/type/file.rb`, and collected all parameters from this type declaration as you would expect. However, it would ignore all other parameters which were defined in the files `lib/puppet/type/file/*.rb`, and thus exlcuding them from the autocompletion list. (see [here](https://github.com/puppetlabs/puppet/tree/main/lib/puppet/type/file)).
12+
13+
## Decision
14+
15+
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.
16+
17+
## Consequences
18+
19+
* `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 commit comments

Comments
 (0)