doi / fileheadercomment Goto Github PK
View Code? Open in Web Editor NEWvisual studio code editor extension
License: MIT License
visual studio code editor extension
License: MIT License
I started using FileHeaderComment extension, and I figured something's missing for the current template I use : ${filename} variable.
If I find a bit of time, I'll check how extensions are made to implement it myself and send a PR.
Is possible create own date time format? I would like to use this format:
dd.mm.YYYY hh:ii:ss
In curent version is not possible :(
is it possible to do triple quote headers in python?
This:
"""
Created on Tue Jul 11 2023
Copyright (c) 2023 Your company
Author
"""
instead of:
#
# Created on Tue Jul 11 2023
#
# Copyright (c) 2023 Your company
# Author
I have python files.
I need to add headers to it.
Following is my settings for the extensions:
"fileHeaderComment.parameter":{
"*":{
// "commentbegin": "/*",
// "commentprefix": " *",
// "commentend": " */",
"company": "My Company.",
"license_text" : [ "Contains trade secrets of My Company",
"Copyright notice does not imply publication.",
"Decompilation or disassembly of this software is strictly prohibited."]
}
},
"fileHeaderComment.template":{
"*":[
"${commentbegin}",
"${commentprefix} Copyright: ${company}, ${year}. All rights reserved.",
"${commentprefix} ${license_text}",
"${commentend}"
]
}
On running the command the format of comment added is as follows:
'''
� Copyright: My Company, 2020. All rights reserved.
� Contains trade secrets of My Company.
�Copyright notice does not imply publication.
�Decompilation or disassembly of this software is strictly prohibited.
'''
The comments are written as strings.
I've installed the extension and configured the template like this
"fileHeaderComment.parameter": { "*": { "comment": "//", "company": "My company", "license": [ "${comment} Licensed under the Apache License, Version 2.0 (the \"License\");", "${comment} you may not use this file except in compliance with the License.", "${comment} You may obtain a copy of the License at", "${comment}", "${comment} http://www.apache.org/licenses/LICENSE-2.0", "${comment}", "${comment} Unless required by applicable law or agreed to in writing, software", "${comment} distributed under the License is distributed on an \"AS IS\" BASIS,", "${comment} WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", "${comment} See the License for the specific language governing permissions and", "${comment} limitations under the License." ] } }, "fileHeaderComment.template": { "*" : [ "${comment} Copyright ${year} ${company}", "${comment}", "${license}", "" ] }
However when i insert the template in any file it shows up like this
`// Copyright 2019 My company
//
// Licensed under the Apache License, Version 2.0 (the "License");
*// you may not use this file except in compliance with the License.
*// You may obtain a copy of the License at
*//
*// http://www.apache.org/licenses/LICENSE-2.0
*//
*// Unless required by applicable law or agreed to in writing, software
*// distributed under the License is distributed on an "AS IS" BASIS,
*// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*// See the License for the specific language governing permissions and
*// limitations under the License.
`
It adds a * on the license lines and i don't know why. There's something i suppose to do to remove this?
Last Modified time should be a feature and it should be update always when a file gets saved and Last modified author as well..
You have awesome feature for adding custom keys, but auto update is needed.
Please have it.
Like
https://marketplace.visualstudio.com/items?itemName=doi.fileheadercomment
Instead of creating a new file and running the FileHeaderComment: Insert Default Template at Cursor command via the command palette manually, is it possible to automate the two-step process such that the command is executed whenever a new file is created?
The feature is to replace the existing copyright header with the new.
This is because, if the file is changed, the timestamp in the copyright comments should get updated. It is manual task to select and delete the comment and then update it with the new.
Limitation: The comments created using the plugin can only be replaced. Not other.
Hey,
I would really like to have a parameter that does not include the file extension.
For example:
filename: vincent.txt
filenameNoExtension: vincent
有没有快捷键
或者文件保存的时候 他自动生成???
This extension could to support placeholders like native snippets? Because I want to comment each file header which is inserted by own comment.
`/* ${1:myComment} ${datetime} ${author} */ ${0}
Steps:
Finish, continue in work ...
Its possible to do that?
Im using this extension because snippets in VSC does not support date/time/datetime variables.
When creating new .java files and setting "autoHeader" to "autoSave", the correct header auto-populates at the top of the new file, but the package identifier ("package com.etc.etc") and class declaration ("public class Class") gets overwritten. Is there a way to auto-generate the headers above the regularly auto-generated content without completely overwriting it? Thanks!
Please let me know if anybody has tried adding the header to multiple files using some setting.
For eg. For multiple ts file at a particular position header should get added.
Please help me to configure this for VS code Editor.
Thanks in advance,
Nilam.
I install it in vs-code 1.19 and i cannot find anything that said in README!
Hi.
The inserted date and time are using UTC timezone, is there a simple way to use CST?
I have set my linux date
command to display CST time. But it still not work for this ext.
Hi,
I was wondering if you could help me understand how to edit the default template as well as how to create multiple templates. Thanks for the extension.
-Rob
It would be really nice if there was a way to add parameters in the workspace settings (think for the like "product name" or something that was going to be specific to a git repo but the format might be universal
add "extensionKind": "ui",
to package.json should do it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.